aboutsummaryrefslogtreecommitdiffstats
path: root/document/src/vespa/document/select/doctype.h
blob: 1e48e5126dafc3998a19c320bdd10457a73adc87 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/**
 * @class document::select::DocType
 * @ingroup select
 *
 * @brief Class matching whether a document is of given type or not.
 *
 * @author H�kon Humberset
 */

#pragma once

#include "node.h"

namespace document::select {

class DocType : public Node
{
private:
    vespalib::string _doctype;

public:
    DocType(vespalib::stringref doctype);

    ResultList contains(const Context&) const override;
    ResultList trace(const Context&, std::ostream& trace) const override;
    void print(std::ostream& out, bool verbose, const std::string& indent) const override;
    void visit(Visitor& v) const override;

    Node::UP clone() const override { return wrapParens(new DocType(_doctype)); }

};

}