Información general
Ejemplos
Pantallas
Comparaciones
Aplicaciones
Descargar
Documentation
"El Mercado"
Estado y Plan de trabajo
Preguntas más frecuentes
Autores y Licencia
Foros
Financiación de U++
Busca en esta página
Idioma
español













SourceForge.net Logo



Esta página aún no ha sido traducida. ¿Quieres traducirla?

 

JSON support

 

Value ParseJSON(CParser& p)

Parses JSON represented from p. It is possible to parse only part of whole text (e.g. when to parse just single element of array - parser then stops at the end of element. Elements of JSON are parsed into corresponding Value types, JSON objects are represented by ValueMap, JSON arrays by ValueArray. If input JSON is invalid throws CParser::Error.

 


 

Value ParseJSON(const char *s)

Parses JSON text s. Elements of JSON are parsed into corresponding Value types, JSON objects are represented by ValueMap, JSON arrays by ValueArray. If input JSON is invalid returns ErrorValue.

 


 

String AsJSON(int i)

String AsJSON(double n)

String AsJSON(bool b)

String AsJSON(const String& s)

String AsJSON(const WString& s)

String AsJSON(const char *s)

Converts basic values to JSON representation.

 


 

String AsJSON(const Value& v, const String& indent, bool pretty)

Encodes v as JSON, interpreting ValueMap as JSON object, ValueArray as JSON array. indent is prepended to each line. If pretty is true, JSON is encoded in lines, indenting each level of embedding, if it is false, JSON is as compact as possible.

 


 

String AsJSON(const Value& v, bool pretty = false)

Same as AsJSON(v, String(), pretty).

 

 

Json

 

class Json

Simple helper class intended for composing JSON strings. Json represents JSON object.

 

 

Constructor Detail

 

Json()

Default constructor. Creates empty JSON object.

 


 

Json& CatRaw(const char *key, const String& val)

Appends raw text (which must be a valid JSON) val and key as key-value pair.

 


 

Json(const char *key, const Value& value)

Json(const char *key, int i)

Json(const char *key, double n)

Json(const char *key, bool b)

Json(const char *key, const String& s)

Json(const char *key, const WString& s)

Json(const char *key, const char *s)

Json(const char *key, const Json& object)

Json(const char *key, const JsonArray& array)

Construct JSON object with single key-value pair.

 

 

Public Member List

 

String ToString() const

String operator~() const

operator String() const

Returns current JSON formatted text.

 


 

operator bool() const

Returns true if any key-value pairs were added to this JSON object.

 


 

Json& operator()(const char *key, const Value& value)

Json& operator()(const char *key, int i)

Json& operator()(const char *key, double n)

Json& operator()(const char *key, bool b)

Json& operator()(const char *key, const String& s)

Json& operator()(const char *key, const WString& s)

Json& operator()(const char *key, const char *s)

Json& operator()(const char *key, const Json& object)

Json& operator()(const char *key, const JsonArray& array)

Adds key-value pair to JSON object.

 

 

 

 

Json

 

class JsonArray

Simple helper class intended for composing JSON strings, representing JSON array.

 

Constructor Detail

 

JsonArray()

Creates empty JSON array.

 

 

Public Member List

 

String ToString() const

String operator~() const

operator String() const

Returns current JSON formatted text.

 


 

operator bool() const

Returns true if there were any elements inserted JSON array.

 


 

JsonArray& CatRaw(const String& val)

Appends raw text (which must be a valid JSON) as an array element.

 


 

JsonArray& operator<<(const Value& value)

JsonArray& operator<<(int i)

JsonArray& operator<<(double n)

JsonArray& operator<<(bool b)

JsonArray& operator<<(const String& s)

JsonArray& operator<<(const WString& s)

JsonArray& operator<<(const char *s)

JsonArray& operator<<(const Json& object)

JsonArray& operator<<(const JsonArray& array)

Adds an element to JSON array.

 

Esta página está también en english. ¿Quieres ayudar?