aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/skiff/skiff_validator.h
blob: 522cc74db68eba13fe8e5a00a933fef6e02581c1 (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
#pragma once

#include "public.h"

#include "skiff_schema.h"

#include <util/string/cast.h>

namespace NSkiff {

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

class TValidatorNodeStack;

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

class TSkiffValidator
{
public:
    explicit TSkiffValidator(std::shared_ptr<TSkiffSchema> skiffSchema);
    ~TSkiffValidator();

    void BeforeVariant8Tag();
    void OnVariant8Tag(ui8 tag);

    void BeforeVariant16Tag();
    void OnVariant16Tag(ui16 tag);

    void OnSimpleType(EWireType value);

    void ValidateFinished();

private:
    const std::unique_ptr<TValidatorNodeStack> Context_;
};

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

} // namespace NSkiff