MistServer  2.5.3-Pro-19-gf5e75b1 ( Generic_64)
Data Structures | Enumerations | Functions
JSON Namespace Reference

JSON-related classes and functions. More...

Data Structures

class  ConstIter
 
class  Iter
 
class  Value
 A JSON::Value is either a string or an integer, but may also be an object, array or null. More...
 

Enumerations

enum  ValueType {
  EMPTY, BOOL, INTEGER, STRING,
  ARRAY, OBJECT, EMPTY, BOOL,
  INTEGER, STRING, ARRAY, OBJECT
}
 Lists all types of JSON::Value. More...
 
enum  ValueType {
  EMPTY, BOOL, INTEGER, STRING,
  ARRAY, OBJECT, EMPTY, BOOL,
  INTEGER, STRING, ARRAY, OBJECT
}
 Lists all types of JSON::Value. More...
 

Functions

template<typename T >
void decodeVector (std::string input, T &result)
 
template<typename T >
void decodeVector4 (std::string input, T &result)
 
template<typename T >
std::string encodeVector (T begin, T end)
 
template<typename T >
std::string encodeVector4 (T begin, T end)
 
Value fromDTMI (std::string &data)
 Parses a std::string to a valid JSON::Value. More...
 
Value fromDTMI (const unsigned char *data, unsigned int len, unsigned int &i)
 Parses a single DTMI type - used recursively by the JSON::fromDTMI functions. More...
 
void fromDTMI (std::string &data, Value &ret)
 Parses a std::string to a valid JSON::Value. More...
 
void fromDTMI (const unsigned char *data, unsigned int len, unsigned int &i, Value &ret)
 Parses a single DTMI type - used recursively by the JSON::fromDTMI functions. More...
 
Value fromDTMI2 (std::string &data)
 
Value fromDTMI2 (const unsigned char *data, unsigned int len, unsigned int &i)
 
void fromDTMI2 (std::string &data, Value &ret)
 
void fromDTMI2 (const unsigned char *data, unsigned int len, unsigned int &i, Value &ret)
 
Value fromFile (std::string filename)
 Converts a file to a JSON::Value. More...
 
Value fromString (std::string json)
 Converts a std::string to a JSON::Value. More...
 

Detailed Description

JSON-related classes and functions.

Enumeration Type Documentation

Lists all types of JSON::Value.

Enumerator
EMPTY 
BOOL 
INTEGER 
STRING 
ARRAY 
OBJECT 
EMPTY 
BOOL 
INTEGER 
STRING 
ARRAY 
OBJECT 

Lists all types of JSON::Value.

Enumerator
EMPTY 
BOOL 
INTEGER 
STRING 
ARRAY 
OBJECT 
EMPTY 
BOOL 
INTEGER 
STRING 
ARRAY 
OBJECT 

Function Documentation

template<typename T >
void JSON::decodeVector ( std::string  input,
T &  result 
)
template<typename T >
void JSON::decodeVector4 ( std::string  input,
T &  result 
)
template<typename T >
std::string JSON::encodeVector ( begin,
end 
)
template<typename T >
std::string JSON::encodeVector4 ( begin,
end 
)
Value JSON::fromDTMI ( std::string &  data)

Parses a std::string to a valid JSON::Value.

This function will find one DTMI object in the string and return it.

Value JSON::fromDTMI ( const unsigned char *  data,
unsigned int  len,
unsigned int &  i 
)

Parses a single DTMI type - used recursively by the JSON::fromDTMI functions.

This function updates i every call with the new position in the data.

Parameters
dataThe raw data to parse.
lenThe size of the raw data.
iCurrent parsing position in the raw data (defaults to 0).
Returns
A single JSON::Value, parsed from the raw data.
void JSON::fromDTMI ( std::string &  data,
Value ret 
)

Parses a std::string to a valid JSON::Value.

This function will find one DTMI object in the string and return it.

void JSON::fromDTMI ( const unsigned char *  data,
unsigned int  len,
unsigned int &  i,
Value ret 
)

Parses a single DTMI type - used recursively by the JSON::fromDTMI functions.

This function updates i every call with the new position in the data.

Parameters
dataThe raw data to parse.
lenThe size of the raw data.
iCurrent parsing position in the raw data (defaults to 0).
retWill be set to JSON::Value, parsed from the raw data.
Value JSON::fromDTMI2 ( std::string &  data)
Value JSON::fromDTMI2 ( const unsigned char *  data,
unsigned int  len,
unsigned int &  i 
)
void JSON::fromDTMI2 ( std::string &  data,
Value ret 
)
void JSON::fromDTMI2 ( const unsigned char *  data,
unsigned int  len,
unsigned int &  i,
Value ret 
)
Value JSON::fromFile ( std::string  filename)

Converts a file to a JSON::Value.

Value JSON::fromString ( std::string  json)

Converts a std::string to a JSON::Value.