top | up | prev | next

JsonObject Class

Definition at line 77 of Json.hpp

Constructors

JsonObject()

Member Functions

void AddField(const std::u32string& fieldName, std::unique_ptr<JsonValue>&& fieldValue)
JsonValue* Clone() const override
JsonValue* GetField(const std::u32string& fieldName)
std::string GetStringField(const std::u32string& fieldName)
std::string ToString() const override
void Write(CodeFormatter& formatter) override

Member Variables

std::map<std::u32string, JsonValue*> fieldMap
std::vector<std::unique_ptr<JsonValue>> fieldValues

Constructor Details

JsonObject Constructor

soulng::util::JsonObject::JsonObject()

Definition at line 130 of Json.cpp :
130 : JsonValue(JsonValueType::object)fieldValues()fieldMap()
131 {
132 }


Declaration at line 80 of Json.hpp


Member Function Details

AddField Member Function

void soulng::util::JsonObject::AddField(const std::u32string& fieldName, std::unique_ptr<JsonValue >&& fieldValue)

Definition at line 134 of Json.cpp :
135 {
136     fieldMap[fieldName] = fieldValue.get();
137     fieldValues.push_back(std::move(fieldValue));
138 }


Declaration at line 81 of Json.hpp

Called by: soulng::util::JsonObject::Clone


Clone Member Function

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

Definition at line 174 of Json.cpp :
175 {
176     JsonObject* clone = new JsonObject();
177     for (const auto& p : fieldMap)
178     {
179         clone->AddField(p.firststd::unique_ptr<JsonValue>(p.second->Clone()));
180     }
181     return clone;
182 }


Declaration at line 84 of Json.hpp

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

Calls: soulng::util::JsonObject::AddField , soulng::util::JsonObject::Clone

Called by: soulng::util::JsonObject::Clone


GetField Member Function

JsonValue * soulng::util::JsonObject::GetField(const std::u32string& fieldName)

Definition at line 140 of Json.cpp
Declaration at line 82 of Json.hpp

Called by: soulng::util::JsonObject::GetStringField


GetStringField Member Function

std::string soulng::util::JsonObject::GetStringField(const std::u32string& fieldName)

Definition at line 153 of Json.cpp
Declaration at line 83 of Json.hpp

Calls: soulng::util::JsonObject::GetField , soulng::util::JsonString::Value , soulng::util::JsonValue::Type


ToString Member Function

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

Definition at line 184 of Json.cpp
Declaration at line 85 of Json.hpp

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

Calls: soulng::util::JsonObject::ToString , soulng::util::JsonString::ToString

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


Write Member Function

void soulng::util::JsonObject::Write(CodeFormatter & formatter) override

Definition at line 206 of Json.cpp
Declaration at line 86 of Json.hpp

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

Calls: soulng::util::CodeFormatter::BeginContent , soulng::util::CodeFormatter::DecIndent , soulng::util::CodeFormatter::EndContent , soulng::util::CodeFormatter::IncIndent , soulng::util::CodeFormatter::Write , soulng::util::CodeFormatter::WriteLine , soulng::util::CodeFormatter::WriteLine , soulng::util::JsonObject::Write , soulng::util::JsonString::Value , soulng::util::JsonValue::Type , soulng::util::JsonValue::Write

Called by: soulng::util::JsonObject::Write


top | up | prev | next