#include "PinnedPartUUIDs.h" #include #include #include #include #include namespace DB { String PinnedPartUUIDs::toString() const { std::vector vec(part_uuids.begin(), part_uuids.end()); Poco::JSON::Object json; json.set(JSON_KEY_UUIDS, DB::toString(vec)); std::ostringstream oss; // STYLE_CHECK_ALLOW_STD_STRING_STREAM oss.exceptions(std::ios::failbit); json.stringify(oss); return oss.str(); } void PinnedPartUUIDs::fromString(const String & buf) { Poco::JSON::Parser parser; auto json = parser.parse(buf).extract(); std::vector vec = parseFromString>(json->getValue(PinnedPartUUIDs::JSON_KEY_UUIDS)); part_uuids.clear(); std::copy(vec.begin(), vec.end(), std::inserter(part_uuids, part_uuids.begin())); } }