aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yson/node/node_visitor.h
blob: 927df5d9e76012bd31150255bd39d71c8d3871f9 (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
37
#pragma once

#include "node.h"

#include <library/cpp/yson/consumer.h>

namespace NYT {

////////////////////////////////////////////////////////////////////////////////

class TNodeVisitor
{
public:
    TNodeVisitor(NYson::IYsonConsumer* consumer, bool sortMapKeys = false);

    void Visit(const TNode& node);
    void VisitMap(const TNode::TMapType& nodeMap); 
    void VisitList(const TNode::TListType& nodeMap); 

private:
    NYson::IYsonConsumer* Consumer_;
    bool SortMapKeys_;

private:
    void VisitAny(const TNode& node);

    void VisitString(const TNode& node);
    void VisitInt64(const TNode& node);
    void VisitUint64(const TNode& node);
    void VisitDouble(const TNode& node);
    void VisitBool(const TNode& node);
    void VisitEntity();
};

////////////////////////////////////////////////////////////////////////////////

} // namespace NYT