diff options
Diffstat (limited to 'library/cpp/yt/string/enum.cpp')
| -rw-r--r-- | library/cpp/yt/string/enum.cpp | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/library/cpp/yt/string/enum.cpp b/library/cpp/yt/string/enum.cpp index 5f8c032edfe..7cb8e5c6b6a 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 |
