top | up | prev | next

JsonString Class

Definition at line 38 of Json.hpp

Constructors

JsonString()
JsonString(const std::u32string& value_)

Member Functions

void Append(char32_t c)
JsonValue* Clone() const override
std::u16string JsonCharStr(char32_t c) const
void SetValue(const std::u32string& value_)
std::string ToString() const override
const std::u32string& Value() const

Member Variables

std::u32string value

Constructor Details

JsonString Constructor

soulng::util::JsonString::JsonString()

Definition at line 28 of Json.cpp :
 28 : JsonValue(JsonValueType::string)value()
 29 {
 30 }


Declaration at line 41 of Json.hpp


JsonString Constructor

soulng::util::JsonString::JsonString(const std::u32string& value_)

Definition at line 32 of Json.cpp :
 32 : JsonValue(JsonValueType::string)value(value_)
 33 {
 34 }


Declaration at line 42 of Json.hpp


Member Function Details

Append Member Function

void soulng::util::JsonString::Append(char32_t c)

Definition at line 46 of Json.cpp :
 47 {
 48     value.append(1c);
 49 }


Declaration at line 43 of Json.hpp


Clone Member Function

JsonValue * soulng::util::JsonString::Clone() const override

Definition at line 36 of Json.cpp :
 37 {
 38     return new JsonString(value);
 39 }


Declaration at line 44 of Json.hpp

Base class overridden functions: soulng::util::JsonValue::Clone


JsonCharStr Member Function

std::u16string soulng::util::JsonString::JsonCharStr(char32_t c) const

Definition at line 51 of Json.cpp
Declaration at line 47 of Json.hpp

Called by: soulng::util::JsonString::ToString


SetValue Member Function

void soulng::util::JsonString::SetValue(const std::u32string& value_)

Definition at line 41 of Json.cpp :
 42 {
 43     value = value_;
 44 }


Declaration at line 46 of Json.hpp


ToString Member Function

std::string soulng::util::JsonString::ToString() const override

Definition at line 84 of Json.cpp :
 85 {
 86     std::u16string s;
 87     for (char32_t c : value)
 88     {
 89         s.append(JsonCharStr(c));
 90     }
 91     return "\"" + ToUtf8(s) + "\"";
 92 }


Declaration at line 48 of Json.hpp

Base class overridden functions: soulng::util::JsonValue::ToString

Calls: soulng::util::JsonString::JsonCharStr

Called by: soulng::util::JsonObject::ToString


Value Member Function

const std::u32string& soulng::util::JsonString::Value() const

Definition at line 45 of Json.hpp :
 45 { return value; }

Called by: soulng::util::JsonObject::GetStringField , soulng::util::JsonObject::Write


top | up | prev | next