aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/string/enum.cpp
diff options
context:
space:
mode:
authorbabenko <babenko@yandex-team.ru>2022-02-10 16:49:19 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:19 +0300
commitf31097c96270919a1f49360bdaaa69ea4f3fefab (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/yt/string/enum.cpp
parentcec37806d8847aa3db53bafc9e251d4aaf325c12 (diff)
downloadydb-f31097c96270919a1f49360bdaaa69ea4f3fefab.tar.gz
Restoring authorship annotation for <babenko@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yt/string/enum.cpp')
-rw-r--r--library/cpp/yt/string/enum.cpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/library/cpp/yt/string/enum.cpp b/library/cpp/yt/string/enum.cpp
index 5f8c032edf..7cb8e5c6b6 100644
--- a/library/cpp/yt/string/enum.cpp
+++ b/library/cpp/yt/string/enum.cpp
@@ -1,44 +1,44 @@
#include "enum.h"
-
+
#include "format.h"
-
-namespace NYT {
-
-////////////////////////////////////////////////////////////////////////////////
-
+
+namespace NYT {
+
+////////////////////////////////////////////////////////////////////////////////
+
TString DecodeEnumValue(TStringBuf value)
-{
- auto camelValue = UnderscoreCaseToCamelCase(value);
+{
+ auto camelValue = UnderscoreCaseToCamelCase(value);
auto underscoreValue = CamelCaseToUnderscoreCase(camelValue);
if (value != underscoreValue) {
- throw TSimpleException(Format("Enum value %Qv is not in a proper underscore case; did you mean %Qv?",
+ throw TSimpleException(Format("Enum value %Qv is not in a proper underscore case; did you mean %Qv?",
value,
- underscoreValue));
+ underscoreValue));
}
- return camelValue;
-}
-
+ return camelValue;
+}
+
TString EncodeEnumValue(TStringBuf value)
-{
- return CamelCaseToUnderscoreCase(value);
-}
-
-namespace NDetail {
-
-void ThrowMalformedEnumValueException(TStringBuf typeName, TStringBuf value)
{
- throw TSimpleException(Format("Error parsing %v value %Qv",
- typeName,
- value));
+ return CamelCaseToUnderscoreCase(value);
}
-void FormatUnknownEnumValue(TStringBuilderBase* builder, TStringBuf name, i64 value)
+namespace NDetail {
+
+void ThrowMalformedEnumValueException(TStringBuf typeName, TStringBuf value)
+{
+ throw TSimpleException(Format("Error parsing %v value %Qv",
+ typeName,
+ value));
+}
+
+void FormatUnknownEnumValue(TStringBuilderBase* builder, TStringBuf name, i64 value)
{
builder->AppendFormat("%v(%v)", name, value);
}
-} // namespace NDetail
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace NYT
+} // namespace NDetail
+
+////////////////////////////////////////////////////////////////////////////////
+
+} // namespace NYT