aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/string/enum.h
blob: 792e09402d56ceed6391335909604f88d3a0103e (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
#pragma once

#include "format_arg.h"

#include <library/cpp/yt/misc/enum.h>

#include <optional>

namespace NYT {

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

std::optional<TString> TryDecodeEnumValue(TStringBuf value);
TString DecodeEnumValue(TStringBuf value);
TString EncodeEnumValue(TStringBuf value);

template <class T>
std::optional<T> TryParseEnum(TStringBuf value);

template <class T>
T ParseEnum(TStringBuf value);

template <class T>
void FormatEnum(TStringBuilderBase* builder, T value, bool lowerCase);

template <class T>
TString FormatEnum(T value);

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

} // namespace NYT

#define ENUM_INL_H_
#include "enum-inl.h"
#undef ENUM_INL_H_