summaryrefslogtreecommitdiffstats
path: root/yql/essentials/sql/v1/proto_parser/reflection.h
blob: 2bf4681d9052f9cef6407311276c4236191f4c78 (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
#pragma once

#include <google/protobuf/message.h>

#include <util/generic/string.h>
#include <util/generic/vector.h>

namespace NSQLTranslationV1 {

TString GetDescription(
    const google::protobuf::Message& node,
    const google::protobuf::FieldDescriptor* d);

TString AltDescription(
    const google::protobuf::Message& node,
    ui32 altCase,
    const google::protobuf::Descriptor* descr);

template <typename TNode>
TString AltDescription(const TNode& node) {
    return AltDescription(node, node.Alt_case(), TNode::descriptor());
}

} // namespace NSQLTranslationV1