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 | 3a00a7f47463f54c5c60c205eac7ab320572e930 (patch) | |
tree | 0f08391e08096f2fff528bae4b01b38eeffdb65f /library/cpp/yaml/as/tstring.h | |
parent | 5f76ab5b18e12d75f0c861e68d730c37e347b965 (diff) | |
download | ydb-3a00a7f47463f54c5c60c205eac7ab320572e930.tar.gz |
Restoring authorship annotation for Andrey Rogozhnikov <rogozhnikov.andrey@gmail.com>. Commit 1 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 1037e46706..454bcb336c 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; + } + }; +} |