aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/json/easy_parse/json_easy_parser_impl.h
blob: 4ac14e8a44095977393c1f786be3998e03226e94 (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
38
39
40
#pragma once

#include <util/generic/string.h>

namespace NJson {
    namespace NImpl {
        enum EType {
            ARRAY,
            MAP,
            MAP_KEY
        };
    }
    template <class TStringType>
    struct TPathElemImpl {
        NImpl::EType Type;
        TStringType Key;
        int ArrayCounter;

        TPathElemImpl(NImpl::EType type)
            : Type(type)
            , ArrayCounter()
        {
        }

        TPathElemImpl(const TStringType& key) 
            : Type(NImpl::MAP_KEY)
            , Key(key)
            , ArrayCounter()
        {
        }

        TPathElemImpl(int arrayCounter)
            : Type(NImpl::ARRAY)
            , ArrayCounter(arrayCounter) 
        { 
        }
    };

    typedef TPathElemImpl<TString> TPathElem;
}