summaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/yson_string
diff options
context:
space:
mode:
authorsabdenovch <[email protected]>2025-12-12 21:59:02 +0300
committersabdenovch <[email protected]>2025-12-12 22:43:53 +0300
commitb13998cfa78bc78c2d55b6e2a3de8a7d08eefcd5 (patch)
tree045be27d8751341c5a1e6690218da5629b8ab688 /library/cpp/yt/yson_string
parent00b948376f5de16a83c930b4c9d9e8c84ef445ca (diff)
YT-22593: TString -> std::string in unittests
commit_hash:e71661ee774f94e598456363e42562c658cce049
Diffstat (limited to 'library/cpp/yt/yson_string')
-rw-r--r--library/cpp/yt/yson_string/convert.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/library/cpp/yt/yson_string/convert.cpp b/library/cpp/yt/yson_string/convert.cpp
index ca344282901..51094255ae7 100644
--- a/library/cpp/yt/yson_string/convert.cpp
+++ b/library/cpp/yt/yson_string/convert.cpp
@@ -315,6 +315,17 @@ TString ConvertFromYsonString<TString>(const TYsonStringBuf& str)
}
template <>
+std::string ConvertFromYsonString<std::string>(const TYsonStringBuf& str)
+{
+ try {
+ // TODO(sabdenovch): Avoid copying.
+ return ParseStringFromYsonString(str);
+ } catch (const std::exception& ex) {
+ throw TYsonLiteralParseException(ex, "Error parsing \"string\" value from YSON");
+ }
+}
+
+template <>
float ConvertFromYsonString<float>(const TYsonStringBuf& str)
{
try {