blob: 1b8bab838360d9073dd337276db4ccdaedd5e862 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
#include "traversingvisitor.h"
namespace document {
class DocumentTypeRepo;
class DocumentType;
}
namespace document::select {
class BodyFieldDetector : public TraversingVisitor
{
const DocumentTypeRepo &_repo;
void detectFieldType(const FieldValueNode *expr, const DocumentType &type);
public:
BodyFieldDetector(const DocumentTypeRepo &repo)
: _repo(repo), foundBodyField(false), foundHeaderField(false)
{
}
bool foundBodyField;
bool foundHeaderField;
void visitDocumentType(const DocType&) override {
// Need to deserialize header to know document type
foundHeaderField = true;
}
void visitFieldValueNode(const FieldValueNode& expr) override;
};
}
|