diff options
author | Andrey Rogozhnikov <rogozhnikov.andrey@gmail.com> | 2022-02-10 16:50:02 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:50:02 +0300 |
commit | 0d6462b7e878d92e0a81ff7d47886837220f4a1a (patch) | |
tree | 5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/yaml/as/tstring.h | |
parent | 3a00a7f47463f54c5c60c205eac7ab320572e930 (diff) | |
download | ydb-0d6462b7e878d92e0a81ff7d47886837220f4a1a.tar.gz |
Restoring authorship annotation for Andrey Rogozhnikov <rogozhnikov.andrey@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/yaml/as/tstring.h')
-rw-r--r-- | library/cpp/yaml/as/tstring.h | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/library/cpp/yaml/as/tstring.h b/library/cpp/yaml/as/tstring.h index 454bcb336c6..1037e467067 100644 --- a/library/cpp/yaml/as/tstring.h +++ b/library/cpp/yaml/as/tstring.h @@ -1,27 +1,27 @@ -#pragma once - -#include <contrib/libs/yaml-cpp/include/yaml-cpp/yaml.h> - -#include <util/generic/string.h> - -namespace YAML { - template <> - inline TString Node::as<TString>() const { - const auto& converted = as<std::string>(); - return TString(converted.c_str(), converted.size()); - } - - template <> - struct convert<TString> { - static Node encode(const TString& rhs) { - return Node(std::string(rhs)); - } - - static bool decode(const Node& node, TString& rhs) { - if (!node.IsScalar()) - return false; - rhs = node.Scalar(); - return true; - } - }; -} +#pragma once + +#include <contrib/libs/yaml-cpp/include/yaml-cpp/yaml.h> + +#include <util/generic/string.h> + +namespace YAML { + template <> + inline TString Node::as<TString>() const { + const auto& converted = as<std::string>(); + return TString(converted.c_str(), converted.size()); + } + + template <> + struct convert<TString> { + static Node encode(const TString& rhs) { + return Node(std::string(rhs)); + } + + static bool decode(const Node& node, TString& rhs) { + if (!node.IsScalar()) + return false; + rhs = node.Scalar(); + return true; + } + }; +} |