diff options
author | yazevnul <yazevnul@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:48 +0300 |
commit | 9abfb1a53b7f7b791444d1378e645d8fad9b06ed (patch) | |
tree | 49e222ea1c5804306084bb3ae065bb702625360f /library/cpp/scheme | |
parent | 8cbc307de0221f84c80c42dcbe07d40727537e2c (diff) | |
download | ydb-9abfb1a53b7f7b791444d1378e645d8fad9b06ed.tar.gz |
Restoring authorship annotation for <yazevnul@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/scheme')
-rw-r--r-- | library/cpp/scheme/scheme.cpp | 2 | ||||
-rw-r--r-- | library/cpp/scheme/scheme.h | 8 | ||||
-rw-r--r-- | library/cpp/scheme/scheme_cast.h | 22 | ||||
-rw-r--r-- | library/cpp/scheme/scimpl_json_write.cpp | 12 | ||||
-rw-r--r-- | library/cpp/scheme/tests/ut/scheme_cast_ut.cpp | 22 |
5 files changed, 33 insertions, 33 deletions
diff --git a/library/cpp/scheme/scheme.cpp b/library/cpp/scheme/scheme.cpp index 9ecdb4ac76..3efd116d4f 100644 --- a/library/cpp/scheme/scheme.cpp +++ b/library/cpp/scheme/scheme.cpp @@ -593,6 +593,6 @@ namespace NSc { } template <> -void Out<NSc::TValue>(IOutputStream& o, TTypeTraits<NSc::TValue>::TFuncParam v) { +void Out<NSc::TValue>(IOutputStream& o, TTypeTraits<NSc::TValue>::TFuncParam v) { o.Write(v.ToJson(true)); } diff --git a/library/cpp/scheme/scheme.h b/library/cpp/scheme/scheme.h index 93ea9e24e4..3d7c59f3c9 100644 --- a/library/cpp/scheme/scheme.h +++ b/library/cpp/scheme/scheme.h @@ -302,15 +302,15 @@ namespace NSc { // TODO: Переименовать ToJson в ToJsonUnsafe, а ToJsonSafe в ToJson TString ToJson(const TJsonOpts& = TJsonOpts()) const; - const TValue& ToJson(IOutputStream&, const TJsonOpts& = TJsonOpts()) const; // returns self + const TValue& ToJson(IOutputStream&, const TJsonOpts& = TJsonOpts()) const; // returns self // ToJson(JO_SORT_KEYS | JO_SKIP_UNSAFE) TString ToJsonSafe(const TJsonOpts& = TJsonOpts()) const; - const TValue& ToJsonSafe(IOutputStream&, const TJsonOpts& = TJsonOpts()) const; + const TValue& ToJsonSafe(IOutputStream&, const TJsonOpts& = TJsonOpts()) const; // ToJson(JO_SORT_KEYS | JO_PRETTY | JO_SKIP_UNSAFE) TString ToJsonPretty(const TJsonOpts& = TJsonOpts()) const; - const TValue& ToJsonPretty(IOutputStream&, const TJsonOpts& = TJsonOpts()) const; + const TValue& ToJsonPretty(IOutputStream&, const TJsonOpts& = TJsonOpts()) const; NJson::TJsonValue ToJsonValue() const; @@ -400,7 +400,7 @@ namespace NSc { return DefaultValue(); } - void DoWriteJsonImpl(IOutputStream&, const TJsonOpts&, NImpl::TKeySortContext&, NImpl::TSelfLoopContext&) const; + void DoWriteJsonImpl(IOutputStream&, const TJsonOpts&, NImpl::TKeySortContext&, NImpl::TSelfLoopContext&) const; bool IsSameOrAncestorOf(const TValue& other) const; diff --git a/library/cpp/scheme/scheme_cast.h b/library/cpp/scheme/scheme_cast.h index 0fa1242da5..00839e8017 100644 --- a/library/cpp/scheme/scheme_cast.h +++ b/library/cpp/scheme/scheme_cast.h @@ -161,13 +161,13 @@ namespace NJsonConverters { typedef typename T::key_type TKey; typedef typename T::mapped_type TMapped; if (validate) - Y_ENSURE(x.IsDict() || x.IsNull(), "not valid input scheme"); + Y_ENSURE(x.IsDict() || x.IsNull(), "not valid input scheme"); out.clear(); if (x.IsDict()) { const NSc::TDict& dict = x.GetDict(); - for (const auto& it : dict) { - TKey key = NJsonConverters::FromString<TKey>(it.first, validate); - TMapped val = NJsonConverters::FromTValue<TMapped>(it.second, validate); + for (const auto& it : dict) { + TKey key = NJsonConverters::FromString<TKey>(it.first, validate); + TMapped val = NJsonConverters::FromTValue<TMapped>(it.second, validate); out.insert(std::pair<TKey, TMapped>(key, val)); } } @@ -187,13 +187,13 @@ namespace NJsonConverters { void FromTValueSet(const NSc::TValue& x, T& out, const bool validate) { typedef typename T::key_type TKey; if (validate) - Y_ENSURE(x.IsDict() || x.IsNull(), "not valid input scheme"); + Y_ENSURE(x.IsDict() || x.IsNull(), "not valid input scheme"); out.clear(); if (x.IsDict()) { const NSc::TDict& dict = x.GetDict(); - for (const auto& it : dict) { + for (const auto& it : dict) { TKey key; - NJsonConverters::FromString<TKey>(it.first, key, validate); + NJsonConverters::FromString<TKey>(it.first, key, validate); out.insert(key); } } @@ -215,14 +215,14 @@ namespace NJsonConverters { template <typename T, typename A> void FromTValue(const NSc::TValue& x, TVector<T, A>& out, const bool validate) { if (validate) - Y_ENSURE(x.IsArray() || x.IsNull(), "not valid input scheme"); + Y_ENSURE(x.IsArray() || x.IsNull(), "not valid input scheme"); out.clear(); if (x.IsArray()) { const NSc::TArray& arr = x.GetArray(); out.reserve(arr.size()); - for (const auto& it : arr) { + for (const auto& it : arr) { T val; - NJsonConverters::FromTValue(it, val, validate); + NJsonConverters::FromTValue(it, val, validate); out.push_back(val); } } @@ -289,7 +289,7 @@ namespace NJsonConverters { template <class T1, class T2> void FromTValue(const NSc::TValue& x, std::pair<T1, T2>& out, const bool validate) { if (validate) - Y_ENSURE(x.IsArray() || x.IsNull(), "not valid input scheme"); + Y_ENSURE(x.IsArray() || x.IsNull(), "not valid input scheme"); if (x.IsArray()) { const NSc::TArray& arr = x.GetArray(); if (arr.size() == 2) { diff --git a/library/cpp/scheme/scimpl_json_write.cpp b/library/cpp/scheme/scimpl_json_write.cpp index f792851098..aadd7e6cd5 100644 --- a/library/cpp/scheme/scimpl_json_write.cpp +++ b/library/cpp/scheme/scimpl_json_write.cpp @@ -18,7 +18,7 @@ namespace NSc { return IsFinite(d); } - static inline void WriteString(IOutputStream& out, TStringBuf s) { + static inline void WriteString(IOutputStream& out, TStringBuf s) { NEscJ::EscapeJ<true, true>(s, out); } @@ -39,7 +39,7 @@ namespace NSc { } template <typename TDictKeys> - static inline void WriteDict(IOutputStream& out, const TDictKeys& keys, const TDict& dict, + static inline void WriteDict(IOutputStream& out, const TDictKeys& keys, const TDict& dict, const TJsonOpts& jopts, NImpl::TKeySortContext& sortCtx, NImpl::TSelfLoopContext& loopCtx) { using const_iterator = typename TDictKeys::const_iterator; const_iterator begin = keys.begin(); @@ -63,7 +63,7 @@ namespace NSc { } } - void TValue::DoWriteJsonImpl(IOutputStream& out, const TJsonOpts& jopts, + void TValue::DoWriteJsonImpl(IOutputStream& out, const TJsonOpts& jopts, NImpl::TKeySortContext& sortCtx, NImpl::TSelfLoopContext& loopCtx) const { const TScCore& core = Core(); @@ -140,7 +140,7 @@ namespace NSc { } } - const TValue& TValue::ToJson(IOutputStream& out, const TJsonOpts& jopts) const { + const TValue& TValue::ToJson(IOutputStream& out, const TJsonOpts& jopts) const { using namespace NImpl; if (jopts.FormatJson) { @@ -179,7 +179,7 @@ namespace NSc { return ToJson(MakeOptsSafeForSerializer(jopts)); } - const TValue& TValue::ToJsonSafe(IOutputStream& out, const TJsonOpts& jopts) const { + const TValue& TValue::ToJsonSafe(IOutputStream& out, const TJsonOpts& jopts) const { return ToJson(out, MakeOptsSafeForSerializer(jopts)); } @@ -187,7 +187,7 @@ namespace NSc { return ToJson(MakeOptsPrettyForSerializer(jopts)); } - const TValue& TValue::ToJsonPretty(IOutputStream& out, const TJsonOpts& jopts) const { + const TValue& TValue::ToJsonPretty(IOutputStream& out, const TJsonOpts& jopts) const { return ToJson(out, MakeOptsPrettyForSerializer(jopts)); } } diff --git a/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp b/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp index b2eb7226b4..4f907157e9 100644 --- a/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp +++ b/library/cpp/scheme/tests/ut/scheme_cast_ut.cpp @@ -16,8 +16,8 @@ using THSI = THashSet<int>; using TSI = TSet<int>; using TPI = std::pair<int, int>; -Y_UNIT_TEST_SUITE(TSchemeCastTest) { - Y_UNIT_TEST(TestYVector) { +Y_UNIT_TEST_SUITE(TSchemeCastTest) { + Y_UNIT_TEST(TestYVector) { TVI v; for (int i = 0; i < 3; ++i) v.push_back(i); @@ -29,7 +29,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { UNIT_ASSERT(std::equal(v.begin(), v.end(), y.begin())); } - Y_UNIT_TEST(TestYHash) { + Y_UNIT_TEST(TestYHash) { THI h; for (int i = 0; i < 3; ++i) h[i] = i * i; @@ -41,7 +41,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { UNIT_ASSERT_VALUES_EQUAL(ToJson(h2, true), ToJson(h, true)); } - Y_UNIT_TEST(TestYMap) { + Y_UNIT_TEST(TestYMap) { TMI h; for (int i = 0; i < 3; ++i) h[i] = i * i; @@ -53,7 +53,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { UNIT_ASSERT_VALUES_EQUAL(ToJson(h2, true), ToJson(h, true)); } - Y_UNIT_TEST(TestYHashSet) { + Y_UNIT_TEST(TestYHashSet) { THSI h; for (int i = 0; i < 3; ++i) h.insert(i * i); @@ -65,7 +65,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { UNIT_ASSERT_VALUES_EQUAL(ToJson(h2, true), ToJson(h, true)); } - Y_UNIT_TEST(TestYSet) { + Y_UNIT_TEST(TestYSet) { TSI h; for (int i = 0; i < 3; ++i) h.insert(i * i); @@ -77,7 +77,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { UNIT_ASSERT_VALUES_EQUAL(ToJson(h2, true), ToJson(h, true)); } - Y_UNIT_TEST(TestTPair) { + Y_UNIT_TEST(TestTPair) { TPI p(1, 1); const TString etalon = "[1,1]"; @@ -113,7 +113,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { } }; - Y_UNIT_TEST(TestTCustom) { + Y_UNIT_TEST(TestTCustom) { TCustom x(2, 3); const TString etalon = "{\"a\":2,\"b\":3}"; @@ -123,7 +123,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { UNIT_ASSERT_VALUES_EQUAL(ToJson(x2, true), ToJson(x, true)); } - Y_UNIT_TEST(TestVectorOfPairs) { + Y_UNIT_TEST(TestVectorOfPairs) { typedef TVector<TPI> TVPI; TVPI v; @@ -137,7 +137,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { UNIT_ASSERT_VALUES_EQUAL(ToJson(v2, true), ToJson(v, true)); } - Y_UNIT_TEST(TestSetOfCustom) { + Y_UNIT_TEST(TestSetOfCustom) { typedef TSet<TCustom> TSC; TSC s; s.insert(TCustom(2, 3)); @@ -149,7 +149,7 @@ Y_UNIT_TEST_SUITE(TSchemeCastTest) { UNIT_ASSERT_VALUES_EQUAL(ToJson(s2, true), ToJson(s, true)); } - Y_UNIT_TEST(TestExceptions) { + Y_UNIT_TEST(TestExceptions) { NSc::TValue v = 1; const TString json = v.ToJson(); UNIT_ASSERT_EXCEPTION(FromJson<TVI>(json, true), yexception); |