Data structure representing JSON format.
More...
#include <json.h>
|
static Json | Load (StringView str, std::ios::openmode mode=std::ios::in) |
| Decode the JSON object. Optional parameter mode for choosing between text and binary (ubjson) input. More...
|
|
static Json | Load (JsonReader *reader) |
| Pass your own JsonReader. More...
|
|
static void | Dump (Json json, std::string *out, std::ios::openmode mode=std::ios::out) |
| Encode the JSON object. Optional parameter mode for choosing between text and binary (ubjson) output. More...
|
|
static void | Dump (Json json, std::vector< char > *out, std::ios::openmode mode=std::ios::out) |
|
static void | Dump (Json json, JsonWriter *writer) |
| Use your own JsonWriter. More...
|
|
template<typename Container = std::string> |
static Container | Dump (Json json) |
|
Data structure representing JSON format.
Limitation: UTF-8 is not properly supported. Code points above ASCII are invalid.
Examples:
object[
"key"] =
String(
"Value");
JsonObject Object
Definition: json.h:614
JsonArray Array
Definition: json.h:615
JsonString String
Definition: json.h:619
◆ Json() [1/11]
◆ Json() [2/11]
◆ Json() [3/11]
◆ Json() [4/11]
◆ Json() [5/11]
template<typename T , Value::ValueKind kind>
◆ Json() [6/11]
◆ Json() [7/11]
◆ Json() [8/11]
◆ Json() [9/11]
◆ Json() [10/11]
xgboost::Json::Json |
( |
Json const & |
other | ) |
|
|
default |
◆ Json() [11/11]
xgboost::Json::Json |
( |
Json && |
other | ) |
|
|
inlinenoexcept |
◆ Dump() [1/4]
template<typename Container = std::string>
static Container xgboost::Json::Dump |
( |
Json |
json | ) |
|
|
inlinestatic |
◆ Dump() [2/4]
◆ Dump() [3/4]
static void xgboost::Json::Dump |
( |
Json |
json, |
|
|
std::string * |
out, |
|
|
std::ios::openmode |
mode = std::ios::out |
|
) |
| |
|
static |
Encode the JSON object. Optional parameter mode for choosing between text and binary (ubjson) output.
◆ Dump() [4/4]
static void xgboost::Json::Dump |
( |
Json |
json, |
|
|
std::vector< char > * |
out, |
|
|
std::ios::openmode |
mode = std::ios::out |
|
) |
| |
|
static |
◆ GetValue() [1/3]
Value& xgboost::Json::GetValue |
( |
| ) |
& |
|
inline |
◆ GetValue() [2/3]
Value const& xgboost::Json::GetValue |
( |
| ) |
&& |
|
inline |
◆ GetValue() [3/3]
Value const& xgboost::Json::GetValue |
( |
| ) |
const & |
|
inline |
Return the reference to stored Json value.
◆ Load() [1/2]
◆ Load() [2/2]
static Json xgboost::Json::Load |
( |
StringView |
str, |
|
|
std::ios::openmode |
mode = std::ios::in |
|
) |
| |
|
static |
Decode the JSON object. Optional parameter mode for choosing between text and binary (ubjson) input.
◆ operator=() [1/10]
Json& xgboost::Json::operator= |
( |
Json && |
other | ) |
|
|
inlinenoexcept |
◆ operator=() [2/10]
Json& xgboost::Json::operator= |
( |
Json const & |
other | ) |
|
|
default |
◆ operator=() [3/10]
◆ operator=() [4/10]
◆ operator=() [5/10]
◆ operator=() [6/10]
◆ operator=() [7/10]
◆ operator=() [8/10]
◆ operator=() [9/10]
◆ operator=() [10/10]
template<typename T , Value::ValueKind kind>
◆ operator==()
bool xgboost::Json::operator== |
( |
Json const & |
rhs | ) |
const |
|
inline |
◆ operator[]() [1/2]
Json& xgboost::Json::operator[] |
( |
int |
ind | ) |
const |
|
inline |
Index Json object with int, used for Json Array.
◆ operator[]() [2/2]
Json& xgboost::Json::operator[] |
( |
std::string const & |
key | ) |
const |
|
inline |
Index Json object with a std::string, used for Json Object.
◆ Ptr()
◆ operator<<
std::ostream& operator<< |
( |
std::ostream & |
os, |
|
|
Json const & |
j |
|
) |
| |
|
friend |
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/xgboost/checkouts/stable/include/xgboost/json.h