Tileson 1.4.0
A helpful json parser for Tiled maps
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
tson::Json11 Class Reference

#include <Json11.hpp>

Inheritance diagram for tson::Json11:
tson::IJson

Public Member Functions

 Json11 ()=default
 
IJsonoperator[] (std::string_view key) override
 
 Json11 (const json11::Json &json)
 
IJsonat (std::string_view key) override
 
IJsonat (size_t pos) override
 
std::vector< std::unique_ptr< IJson > > array () override
 
std::vector< std::unique_ptr< IJson > > & array (std::string_view key) override
 
size_t size () const override
 
bool parse (const fs::path &path) override
 
bool parse (const void *data, size_t size) override
 
size_t count (std::string_view key) const override
 
bool any (std::string_view key) const override
 
bool isArray () const override
 
bool isObject () const override
 
bool isNull () const override
 
fs::path directory () const override
 
void directory (const fs::path &directory) override
 
std::unique_ptr< IJsoncreate () override
 
- Public Member Functions inherited from tson::IJson
template<typename T >
get (std::string_view key)
 
template<typename T >
get ()
 
virtual ~IJson ()=default
 

Protected Member Functions

int32_t getInt32 (std::string_view key) override
 
uint32_t getUInt32 (std::string_view key) override
 
int64_t getInt64 (std::string_view key) override
 
uint64_t getUInt64 (std::string_view key) override
 
double getDouble (std::string_view key) override
 
std::string getString (std::string_view key) override
 
bool getBool (std::string_view key) override
 
float getFloat (std::string_view key) override
 
int32_t getInt32 () override
 
uint32_t getUInt32 () override
 
int64_t getInt64 () override
 
uint64_t getUInt64 () override
 
double getDouble () override
 
std::string getString () override
 
bool getBool () override
 
float getFloat () override
 

Constructor & Destructor Documentation

◆ Json11() [1/2]

tson::Json11::Json11 ( )
inlinedefault

◆ Json11() [2/2]

tson::Json11::Json11 ( const json11::Json &  json)
inlineexplicit

Member Function Documentation

◆ any()

bool tson::Json11::any ( std::string_view  key) const
inlineoverridevirtual

Implements tson::IJson.

◆ array() [1/2]

std::vector< std::unique_ptr< IJson > > tson::Json11::array ( )
inlineoverridevirtual

If current json object is an array, this will get all elements of it!

Returns
An array

Implements tson::IJson.

◆ array() [2/2]

std::vector< std::unique_ptr< IJson > > & tson::Json11::array ( std::string_view  key)
inlineoverridevirtual

Implements tson::IJson.

◆ at() [1/2]

IJson & tson::Json11::at ( size_t  pos)
inlineoverridevirtual

Implements tson::IJson.

◆ at() [2/2]

IJson & tson::Json11::at ( std::string_view  key)
inlineoverridevirtual

Implements tson::IJson.

◆ count()

size_t tson::Json11::count ( std::string_view  key) const
inlineoverridevirtual

Implements tson::IJson.

◆ create()

std::unique_ptr< IJson > tson::Json11::create ( )
inlineoverridevirtual

Create a new empty instance using the same engine

Implements tson::IJson.

◆ directory() [1/2]

fs::path tson::Json11::directory ( ) const
inlineoverridevirtual

Get the directory where the json was loaded. Only assigned if json is parsed by file.

Returns

Implements tson::IJson.

◆ directory() [2/2]

void tson::Json11::directory ( const fs::path &  directory)
inlineoverridevirtual

Implements tson::IJson.

◆ getBool() [1/2]

bool tson::Json11::getBool ( )
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getBool() [2/2]

bool tson::Json11::getBool ( std::string_view  key)
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getDouble() [1/2]

double tson::Json11::getDouble ( )
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getDouble() [2/2]

double tson::Json11::getDouble ( std::string_view  key)
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getFloat() [1/2]

float tson::Json11::getFloat ( )
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getFloat() [2/2]

float tson::Json11::getFloat ( std::string_view  key)
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getInt32() [1/2]

int32_t tson::Json11::getInt32 ( )
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getInt32() [2/2]

int32_t tson::Json11::getInt32 ( std::string_view  key)
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getInt64() [1/2]

int64_t tson::Json11::getInt64 ( )
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getInt64() [2/2]

int64_t tson::Json11::getInt64 ( std::string_view  key)
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getString() [1/2]

std::string tson::Json11::getString ( )
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getString() [2/2]

std::string tson::Json11::getString ( std::string_view  key)
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getUInt32() [1/2]

uint32_t tson::Json11::getUInt32 ( )
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getUInt32() [2/2]

uint32_t tson::Json11::getUInt32 ( std::string_view  key)
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getUInt64() [1/2]

uint64_t tson::Json11::getUInt64 ( )
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ getUInt64() [2/2]

uint64_t tson::Json11::getUInt64 ( std::string_view  key)
inlineoverrideprotectedvirtual

Implements tson::IJson.

◆ isArray()

bool tson::Json11::isArray ( ) const
inlineoverridevirtual

Implements tson::IJson.

◆ isNull()

bool tson::Json11::isNull ( ) const
inlineoverridevirtual

Implements tson::IJson.

◆ isObject()

bool tson::Json11::isObject ( ) const
inlineoverridevirtual

Implements tson::IJson.

◆ operator[]()

IJson & tson::Json11::operator[] ( std::string_view  key)
inlineoverridevirtual

Implements tson::IJson.

◆ parse() [1/2]

bool tson::Json11::parse ( const fs::path &  path)
inlineoverridevirtual

Implements tson::IJson.

◆ parse() [2/2]

bool tson::Json11::parse ( const void *  data,
size_t  size 
)
inlineoverridevirtual

Implements tson::IJson.

◆ size()

size_t tson::Json11::size ( ) const
inlineoverridevirtual

Get the size of an object. This will be equal to the number of variables an object contains.

Returns

Implements tson::IJson.


The documentation for this class was generated from the following file: