added Space::serialize_to_string(StreamType & stream) template

This commit is contained in:
Tomasz Sowa 2021-06-22 17:52:55 +02:00
parent 99fbdc1635
commit c1f1dc96df
1 changed files with 21 additions and 0 deletions

View File

@ -501,6 +501,27 @@ public:
void remove(const std::wstring & field); void remove(const std::wstring & field);
template<typename StreamType>
void serialize_to_string(StreamType & stream) const
{
if( type == type_wstring )
{
stream << value.value_wstring;
}
else
if( type == type_string )
{
stream << value.value_string;
}
else
{
serialize_to_json_stream(stream);
}
}
std::string serialize_to_space_str(bool pretty_print = false) const; std::string serialize_to_space_str(bool pretty_print = false) const;
std::wstring serialize_to_space_wstr(bool pretty_print = false) const; std::wstring serialize_to_space_wstr(bool pretty_print = false) const;
void serialize_to_space_to(std::string & str, bool pretty_print = false) const; void serialize_to_space_to(std::string & str, bool pretty_print = false) const;