top | up | prev | next

JsonArray Class

Definition at line 92 of Json.hpp

Constructors

JsonArray()

Member Functions

void AddItem(std::unique_ptr<JsonValue>&& item)
JsonValue* Clone() const override
int Count() const
std::string ToString() const override
void Write(CodeFormatter& formatter) override
JsonValue* operator[](int index) const

Member Variables

std::vector<std::unique_ptr<JsonValue>> items

Constructor Details

JsonArray Constructor

soulng::util::JsonArray::JsonArray()

Definition at line 249 of Json.cpp :
249 : JsonValue(JsonValueType::array)
250 {
251 }


Declaration at line 95 of Json.hpp


Member Function Details

AddItem Member Function

void soulng::util::JsonArray::AddItem(std::unique_ptr<JsonValue >&& item)

Definition at line 253 of Json.cpp :
254 {
255     items.push_back(std::move(item));
256 }


Declaration at line 96 of Json.hpp

Called by: soulng::util::JsonArray::Clone


Clone Member Function

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

Definition at line 258 of Json.cpp :
259 {
260     JsonArray* clone = new JsonArray();
261     for (const std::std::unique_ptr<JsonValue>&item : items)
262     {
263         clone->AddItem(std::unique_ptr<JsonValue>(item->Clone()));
264     }
265     return clone;
266 }


Declaration at line 99 of Json.hpp

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

Calls: soulng::util::JsonArray::AddItem , soulng::util::JsonArray::Clone

Called by: soulng::util::JsonArray::Clone


Count Member Function

int soulng::util::JsonArray::Count() const

Definition at line 97 of Json.hpp :
 97 { return items.size(); }


ToString Member Function

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

Definition at line 273 of Json.cpp
Declaration at line 100 of Json.hpp

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

Calls: soulng::util::JsonArray::ToString

Called by: soulng::util::JsonArray::ToString


Write Member Function

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

Definition at line 293 of Json.cpp
Declaration at line 101 of Json.hpp

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

Calls: soulng::util::CodeFormatter::DecIndent , soulng::util::CodeFormatter::IncIndent , soulng::util::CodeFormatter::WriteLine , soulng::util::CodeFormatter::WriteLine , soulng::util::JsonArray::Write , soulng::util::JsonValue::Type

Called by: soulng::util::JsonArray::Write


operator[] Member Function

JsonValue * soulng::util::JsonArray::operator[](int index) const

Definition at line 268 of Json.cpp :
269 {
270     return items[index].get();
271 }


Declaration at line 98 of Json.hpp


top | up | prev | next