10Duke Scale C++ Client
Loading...
Searching...
No Matches
tenduke::json::JSONObjectBuilder Class Reference

#include <JSONBuilder.h>

Detailed Description

Builds JSON objects.

Public Member Functions

 JSONObjectBuilder (bool pretty=true)
 Constructs new instance.
 
JSONObjectBuilderproperty (const char *name, const JSONArrayBuilder &array)
 Adds JSON array property.
 
JSONObjectBuilderproperty (const char *name, const JSONObjectBuilder &object)
 Adds JSON object property.
 
JSONObjectBuilderproperty (const char *name, bool value)
 Adds boolean property.
 
JSONObjectBuilderproperty (const char *name, const char *value, bool evenIfValueEmpty=false)
 Adds string property.
 
JSONObjectBuilderproperty (const char *name, const std::string &value, bool evenIfValueEmpty=false)
 Adds string property.
 
JSONObjectBuilderproperty (const char *name, int value)
 Adds int property.
 
JSONObjectBuilderproperty (const char *name, std::int64_t value)
 Adds int64-property.
 
JSONObjectBuilderproperty (const char *name, std::uint64_t value)
 Adds uin64t-property.
 
JSONObjectBuilderproperty (const std::string &name, const JSONArrayBuilder &array)
 Adds JSON array property.
 
JSONObjectBuilderproperty (const std::string &name, const JSONObjectBuilder &object)
 Adds JSON object property.
 
JSONObjectBuilderproperty (const std::string &name, bool value)
 Adds boolean property.
 
JSONObjectBuilderproperty (const std::string &name, const char *value, bool evenIfValueEmpty=false)
 Adds string property.
 
JSONObjectBuilderproperty (const std::string &name, const std::string &value, bool evenIfValueEmpty=false)
 Adds string property.
 
JSONObjectBuilderproperty (const std::string &name, int value)
 Adds int property.
 
JSONObjectBuilderproperty (const std::string &name, std::int64_t value)
 Adds int64 property.
 
JSONObjectBuilderproperty (const std::string &name, std::uint64_t value)
 Adds uint64 property.
 

Friends

class JSONBuilder
 
class JSONArrayBuilder
 

Constructor & Destructor Documentation

◆ JSONObjectBuilder()

tenduke::json::JSONObjectBuilder::JSONObjectBuilder ( bool  pretty = true)
explicit

Constructs new instance.

Parameters
pretty-

Member Function Documentation

◆ property() [1/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const char *  name,
bool  value 
)

Adds boolean property.

Parameters
name-
value-
Returns
-

◆ property() [2/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const char *  name,
const char *  value,
bool  evenIfValueEmpty = false 
)

Adds string property.

Parameters
name-
value-
evenIfValueEmpty-
Returns
-

◆ property() [3/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const char *  name,
const JSONArrayBuilder array 
)

Adds JSON array property.

Parameters
name-
array-
Returns
-

◆ property() [4/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const char *  name,
const JSONObjectBuilder object 
)

Adds JSON object property.

Parameters
name-
object-
Returns
-

◆ property() [5/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const char *  name,
const std::string &  value,
bool  evenIfValueEmpty = false 
)

Adds string property.

Parameters
name-
value-
evenIfValueEmpty-
Returns
-

◆ property() [6/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const char *  name,
int  value 
)

Adds int property.

Parameters
name-
value-
Returns
-

◆ property() [7/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const char *  name,
std::int64_t  value 
)

Adds int64-property.

Parameters
name-
value-
Returns
-

◆ property() [8/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const char *  name,
std::uint64_t  value 
)

Adds uin64t-property.

Parameters
name-
value-
Returns
-

◆ property() [9/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const std::string &  name,
bool  value 
)

Adds boolean property.

Parameters
name-
value-
Returns
-

◆ property() [10/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const std::string &  name,
const char *  value,
bool  evenIfValueEmpty = false 
)

Adds string property.

Parameters
name-
value-
evenIfValueEmpty-
Returns
-

◆ property() [11/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const std::string &  name,
const JSONArrayBuilder array 
)

Adds JSON array property.

Parameters
name-
array-
Returns
-

◆ property() [12/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const std::string &  name,
const JSONObjectBuilder object 
)

Adds JSON object property.

Parameters
name-
object-
Returns
-

◆ property() [13/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const std::string &  name,
const std::string &  value,
bool  evenIfValueEmpty = false 
)

Adds string property.

Parameters
name-
value-
evenIfValueEmpty-
Returns
-

◆ property() [14/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const std::string &  name,
int  value 
)

Adds int property.

Parameters
name-
value-
Returns
-

◆ property() [15/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const std::string &  name,
std::int64_t  value 
)

Adds int64 property.

Parameters
name-
value-
Returns
-

◆ property() [16/16]

xdjson::JSONObjectBuilder & tenduke::json::JSONObjectBuilder::property ( const std::string &  name,
std::uint64_t  value 
)

Adds uint64 property.

Parameters
name-
value-
Returns
-

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