diff options
| author | babenko <[email protected]> | 2022-02-10 16:49:19 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:49:19 +0300 | 
| commit | f31097c96270919a1f49360bdaaa69ea4f3fefab (patch) | |
| tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/yt/string/enum.cpp | |
| parent | cec37806d8847aa3db53bafc9e251d4aaf325c12 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
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 | 
