![]() |
vitasdk
Documentation of the vitasdk
|
Exports for User. More...
Namespaces | |
| namespace | sce |
| namespace | sce::Json |
Data Structures | |
| class | sce::Json::MemAllocator |
| Base class for reimplementation of memory allocation. More... | |
| class | sce::Json::InitParameter |
| Utility Data Structure to pass on initialisation parameters. More... | |
| class | sce::Json::Initializer |
| Utility class for initialising and terminating the library. More... | |
| class | sce::Json::Array |
| Class for JSON arrays. More... | |
| class | sce::Json::Array::iterator |
| Class for iterating over Array members. More... | |
| class | sce::Json::String |
| Class for JSON strings. More... | |
| class | sce::Json::Value |
| Class for value of JSON property. More... | |
| class | sce::Json::Object |
| Class for JSON objects. More... | |
| class | sce::Json::Object::Pair |
| Key-Value Pair of JSON Object property. More... | |
| class | sce::Json::Object::iterator |
| Class for iterating over Object members. More... | |
| class | sce::Json::Parser |
| Static Class for parsing. More... | |
Typedefs | |
| typedef int(* | sce::Json::Value::SerializeCallback) (String &str, void *userData) |
| Callback for serialization. | |
| typedef Value const &(* | sce::Json::Value::NullAccessCallback) (ValueType type, const Value *parent, void *userData) |
| Callback for NullValue access. | |
| typedef int(* | sce::Json::Parser::ParseCallback) (char &ch, void *userData) |
| Callback for outputing a character to parse. | |
Enumerations | |
| enum | SceJsonErrorCode { SCE_JSON_ERROR_UNLOADED = 0x80920110 , SCE_JSON_ERROR_LOADED = 0x80920111 , SCE_JSON_ERROR_MEM_ALLOC = 0x80920102 , SCE_JSON_PARSER_ERROR_EMPTY_BUF = 0x80920105 , SCE_JSON_PARSER_ERROR_FILE_LOAD = 0x80920103 , SCE_JSON_PARSER_ERROR_INVALID_TOKEN = 0x80920101 } |
| Enumerator of different errors in this library. More... | |
| enum class | sce::Json::ValueType |
| Strongly typed Enumerator of different types of Values. More... | |
Functions | |
| sce::Json::MemAllocator::MemAllocator () | |
| virtual | sce::Json::MemAllocator::~MemAllocator () |
| virtual void * | sce::Json::MemAllocator::allocateMemory (SceSize size, void *userData)=0 |
| Virtual Function for memory allocation. | |
| virtual void | sce::Json::MemAllocator::freeMemory (void *ptr, void *userData)=0 |
| Virtual Function for memory deallocation. | |
| virtual void | sce::Json::MemAllocator::notifyError (int errorCode, SceSize size, void *userData) |
| The base class definition prints an error to sceClibPrintf. | |
| sce::Json::Initializer::Initializer () | |
| sce::Json::Initializer::~Initializer () | |
| int | sce::Json::Initializer::initialize (const InitParameter *initParams) |
| Initialise the library. | |
| int | sce::Json::Initializer::terminate () |
| Terminate the library. | |
| sce::Json::Array::iterator::iterator () | |
| sce::Json::Array::iterator::iterator (const iterator &iter) | |
| sce::Json::Array::iterator::~iterator () | |
| void | sce::Json::Array::iterator::advance (SceSize adv) |
| Advance the iterator by adv. | |
| iterator & | sce::Json::Array::iterator::operator= (const iterator &iter) |
| Assignment operator. | |
| void | sce::Json::Array::iterator::operator++ (int adv) |
| Advance the iterator by adv. | |
| void | sce::Json::Array::iterator::operator++ () |
| Increment the iterator. | |
| Value & | sce::Json::Array::iterator::operator* () const |
| Dereference the iterator. | |
| bool | sce::Json::Array::iterator::operator!= (iterator iter) const |
| Compare to another iterator. | |
| Value * | sce::Json::Array::iterator::operator-> () const |
| Access the Value being pointed to. | |
| sce::Json::Array::Array () | |
| sce::Json::Array::Array (const Array &arr) | |
| sce::Json::Array::~Array () | |
| iterator | sce::Json::Array::begin () const |
| Get an iterator pointing to the start of the Array. | |
| iterator | sce::Json::Array::end () const |
| Get an iterator pointing to after the end of the Array. | |
| iterator | sce::Json::Array::insert (const iterator &pos, const Value &val) |
| Insert a Value at pos. | |
| iterator | sce::Json::Array::erase (const iterator &pos) |
| Erase the Value at pos. | |
| Value & | sce::Json::Array::back () const |
| Returns a reference to the last element in the Array. | |
| void | sce::Json::Array::clear () |
| Will empty the Array, removing all child values. | |
| void | sce::Json::Array::push_back (const Value &val) |
| Adds val to the end of the Array. | |
| void | sce::Json::Array::pop_back () |
| Removes the last child value. | |
| SceSize | sce::Json::Array::size () const |
| Get the size of the array. | |
| bool | sce::Json::Array::empty () const |
| Is the array empty. | |
| Array & | sce::Json::Array::operator= (const Array &arr) |
| Assignment Operator. | |
| sce::Json::String::String () | |
| sce::Json::String::String (const char *s) | |
| sce::Json::String::String (const String &str) | |
| sce::Json::String::~String () | |
| String & | sce::Json::String::append (const char *s) |
| Append string s to the end. | |
| String & | sce::Json::String::append (const char *s, SceSize pos) |
| Append string s to position pos. | |
| String & | sce::Json::String::append (const String &str) |
| Append string str. | |
| String | sce::Json::String::substr (SceSize pos=0, SceSize len=npos) const |
| Returns a newly constructed string object with its value initialized to a copy of a substring of this object. | |
| char | sce::Json::String::at (SceSize pos) const |
| Returns the character found at pos. | |
| SceSize | sce::Json::String::find (const char *s, SceSize pos) const |
| Searches the string for the first instance of a sequence. | |
| SceSize | sce::Json::String::find (const char *s, SceSize pos, SceSize n) const |
| Searches the string for the first instance of a sequence. | |
| SceSize | sce::Json::String::find (const String &str, SceSize pos) const |
| Searches the string for the first instance of a sequence. | |
| SceSize | sce::Json::String::find (char c, SceSize pos) const |
| Searches the string for the first instance of a sequence. | |
| SceSize | sce::Json::String::rfind (const char *s, SceSize pos) const |
| Searches the string for the last instance of a sequence. | |
| SceSize | sce::Json::String::rfind (const char *s, SceSize pos, SceSize n) const |
| Searches the string for the last instance of a sequence. | |
| SceSize | sce::Json::String::rfind (const String &str, SceSize pos) const |
| Searches the string for the last instance of a sequence. | |
| SceSize | sce::Json::String::rfind (char c, SceSize pos) const |
| Searches the string for the last instance of a sequence. | |
| void | sce::Json::String::clear () |
| Clears the string's contents. | |
| bool | sce::Json::String::empty () const |
| Returns whether the string is empty or not. | |
| SceSize | sce::Json::String::size () const |
| Returns the length of the String in bytes. | |
| SceSize | sce::Json::String::length () const |
| Returns the length of the String in bytes. | |
| const char * | sce::Json::String::c_str () const |
| Returns a C style string buffer of the String. | |
| void | sce::Json::String::resize (SceSize n) |
| Resizes the string to a length of n characters. | |
| bool | sce::Json::String::compare (const char *s) const |
| Compares the string to s. | |
| bool | sce::Json::String::compare (const String &str) const |
| Compares the string to str. | |
| String & | sce::Json::String::operator+= (const char *s) |
| Appends s to the string. | |
| String & | sce::Json::String::operator+= (unsigned char c) |
| Appends c to the string. | |
| bool | sce::Json::String::operator== (const char *s) const |
| Compares the string to s. | |
| bool | sce::Json::String::operator== (const String &str) const |
| Compares the string to str. | |
| String & | sce::Json::String::operator= (const String &str) |
| Assignment Operator. | |
| sce::Json::Value::Value () | |
| sce::Json::Value::Value (ValueType type) | |
| sce::Json::Value::Value (SceBool value) | |
| sce::Json::Value::Value (SceInt64 value) | |
| sce::Json::Value::Value (SceUInt64 value) | |
| sce::Json::Value::Value (double value) | |
| sce::Json::Value::Value (const String &value) | |
| sce::Json::Value::Value (const Array &value) | |
| sce::Json::Value::Value (const Object &value) | |
| sce::Json::Value::Value (const Value &value) | |
| sce::Json::Value::~Value () | |
| void | sce::Json::Value::toString (String &s) const |
| Sets s to be a string representation of the value. | |
| void | sce::Json::Value::swap (Value &val) |
| Swaps the value with another Value. | |
| void | sce::Json::Value::clear () |
| Clears the value by setting to null. | |
| SceSize | sce::Json::Value::count () const |
| Returns number of children. | |
| ValueType | sce::Json::Value::getType () const |
| Returns the ValueType of the value. | |
| void | sce::Json::Value::set (ValueType type) |
| Set the type. | |
| void | sce::Json::Value::set (bool value) |
| Set the value to a boolean. | |
| void | sce::Json::Value::set (SceInt64 value) |
| Set the value to a long integer(64 bits) | |
| void | sce::Json::Value::set (SceUInt64 value) |
| Set the value to an unsigned long integer(64 bits) | |
| void | sce::Json::Value::set (double value) |
| Set the value to a double precision float. | |
| void | sce::Json::Value::set (const String &value) |
| Set the value to a String. | |
| void | sce::Json::Value::set (const Array &value) |
| Set the value to an Array. | |
| void | sce::Json::Value::set (const Object &value) |
| Set the value to an Object. | |
| void | sce::Json::Value::set (const Value &value) |
| Set the value. | |
| int | sce::Json::Value::setNullAccessCallback (NullAccessCallback cb, void *userData) |
| Set the Value's NullAccessCallback. | |
| Value & | sce::Json::Value::getRoot () const |
| Returns a reference to the root Value. | |
| const bool & | sce::Json::Value::getBoolean () const |
| Returns a constant reference to the value. | |
| const SceInt64 & | sce::Json::Value::getInteger () const |
| Returns a constant reference to the value. | |
| const SceUInt64 & | sce::Json::Value::getUInteger () const |
| Returns a constant reference to the value. | |
| const SceDouble & | sce::Json::Value::getReal () const |
| Returns a constant reference to the value. | |
| const String & | sce::Json::Value::getString () const |
| Returns a constant reference to the string. | |
| const Array & | sce::Json::Value::getArray () const |
| Returns a constant reference to the array. | |
| const Object & | sce::Json::Value::getObject () const |
| Returns a constant reference to the object. | |
| const Value & | sce::Json::Value::getValue (SceSize pos) const |
| Returns a constant reference to the value. | |
| const Value & | sce::Json::Value::getValue (const String &key) const |
| Returns a constant reference to the value. | |
| SceBool * | sce::Json::Value::referBoolean () |
| Returns a pointer to the value. | |
| SceInt64 * | sce::Json::Value::referInteger () |
| Returns a pointer to the value. | |
| SceUInt64 * | sce::Json::Value::referUInteger () |
| Returns a pointer to the value. | |
| SceDouble * | sce::Json::Value::referReal () |
| Returns a pointer to the value. | |
| String * | sce::Json::Value::referString () |
| Returns a pointer to the string. | |
| Array * | sce::Json::Value::referArray () |
| Returns a pointer to the array. | |
| Object * | sce::Json::Value::referObject () |
| Returns a pointer to the object. | |
| Value * | sce::Json::Value::referValue (SceSize pos) |
| Returns a pointer to the value. | |
| Value * | sce::Json::Value::referValue (const String &key) |
| Returns a pointer to the value. | |
| int | sce::Json::Value::serialize (String &s) |
| Serializes the data into a string in JSON format. | |
| int | sce::Json::Value::serialize (String &str, SerializeCallback cb, void *userData) |
| Serializes the values into a string in JSON format. | |
| const Value & | sce::Json::Value::operator[] (const String &key) const |
| Returns constant reference of the Value of key. | |
| const Value & | sce::Json::Value::operator[] (const char *key) const |
| Returns constant reference of the Value of key. | |
| const Value & | sce::Json::Value::operator[] (SceSize pos) const |
| Returns constant reference of the Value at pos. | |
| Value & | sce::Json::Value::operator= (const Value &value) |
| Assignment Operator. | |
| sce::Json::Value::operator bool () const | |
| sce::Json::Object::Pair::Pair () | |
| sce::Json::Object::Pair::Pair (const String &name, const Value &value) | |
| sce::Json::Object::Pair::~Pair () | |
| sce::Json::Object::iterator::iterator () | |
| sce::Json::Object::iterator::iterator (const iterator &iter) | |
| sce::Json::Object::iterator::~iterator () | |
| void | sce::Json::Object::iterator::advance (SceSize adv) |
| Advance the iterator. | |
| iterator & | sce::Json::Object::iterator::operator++ (int adv) |
| Increment the iterator. | |
| iterator & | sce::Json::Object::iterator::operator++ () |
| Increment the iterator. | |
| Pair & | sce::Json::Object::iterator::operator* () const |
| Dereference the iterator. | |
| bool | sce::Json::Object::iterator::operator== (iterator iter) const |
| Compare to another iterator. | |
| bool | sce::Json::Object::iterator::operator!= (iterator iter) const |
| Compare to another iterator. | |
| Pair * | sce::Json::Object::iterator::operator-> () const |
| Access the Pair the iterator is pointing to. | |
| iterator & | sce::Json::Object::iterator::operator= (const iterator &iter) |
| Assignment Operator. | |
| sce::Json::Object::Object () | |
| sce::Json::Object::Object (const Object &obj) | |
| sce::Json::Object::~Object () | |
| iterator | sce::Json::Object::begin () const |
| Returns an iterator to the first child element. | |
| iterator | sce::Json::Object::end () const |
| Returns an iterator to after the last child element. | |
| iterator | sce::Json::Object::insert (const Pair &p) |
| Inserts a pair into the Object. | |
| iterator | sce::Json::Object::find (const String &key) const |
| Finds a Pair with a matching key. | |
| void | sce::Json::Object::clear () |
| Empty the object. | |
| void | sce::Json::Object::erase (const String &str) |
| Remove the Pair with the key str. | |
| SceSize | sce::Json::Object::size () const |
| Gets the number of child Pairs. | |
| bool | sce::Json::Object::empty () const |
| Is the object empty? | |
| Value & | sce::Json::Object::operator[] (const String &str) |
| Searches for a pair with a key matching str. | |
| Object & | sce::Json::Object::operator= (const Object &obj) |
| Assignment Operator. | |
| static int | sce::Json::Parser::parse (Value &val, ParseCallback cb, void *userData) |
| Parses user defined data using characters from a user defined callback function. | |
| static int | sce::Json::Parser::parse (Value &val, const char *buf, SceSize size) |
| Parses a string buffer. | |
| static int | sce::Json::Parser::parse (Value &val, const char *path) |
| Parse a JSON file. | |
Exports for User.
Include the header file in your project:
Link the library to the executable:
Load the required module:
| class sce::Json::MemAllocator |
Base class for reimplementation of memory allocation.
This class must be derived from.
Public Member Functions | |
| MemAllocator () | |
| virtual | ~MemAllocator () |
| virtual void * | allocateMemory (SceSize size, void *userData)=0 |
| Virtual Function for memory allocation. | |
| virtual void | freeMemory (void *ptr, void *userData)=0 |
| Virtual Function for memory deallocation. | |
| virtual void | notifyError (int errorCode, SceSize size, void *userData) |
| The base class definition prints an error to sceClibPrintf. | |
| class sce::Json::InitParameter |
Utility Data Structure to pass on initialisation parameters.
| Data Fields | ||
|---|---|---|
| MemAllocator * | allocator |
Pointer to a MemAllocator object for internal memory allocations. Required field. |
| void * | userData | User defined data sent to overriden MemAllocator functions. |
| SceSize | bufSize |
Size of the buffer used for reading JSON file data in Parser::parse(Value&, const char*). Does not have to be the size of the file, but a smaller buffer size will result in more IO calls. |
| class sce::Json::Initializer |
Utility class for initialising and terminating the library.
Public Member Functions | |
| Initializer () | |
| ~Initializer () | |
| int | initialize (const InitParameter *initParams) |
| Initialise the library. | |
| int | terminate () |
| Terminate the library. | |
| class sce::Json::Array |
Class for JSON arrays.
Public Member Functions | |
| Array () | |
| Array (const Array &arr) | |
| ~Array () | |
| iterator | begin () const |
| Get an iterator pointing to the start of the Array. | |
| iterator | end () const |
| Get an iterator pointing to after the end of the Array. | |
| iterator | insert (const iterator &pos, const Value &val) |
| Insert a Value at pos. | |
| iterator | erase (const iterator &pos) |
| Erase the Value at pos. | |
| Value & | back () const |
| Returns a reference to the last element in the Array. | |
| void | clear () |
| Will empty the Array, removing all child values. | |
| void | push_back (const Value &val) |
| Adds val to the end of the Array. | |
| void | pop_back () |
| Removes the last child value. | |
| SceSize | size () const |
| Get the size of the array. | |
| bool | empty () const |
| Is the array empty. | |
| Array & | operator= (const Array &arr) |
| Assignment Operator. | |
Private Attributes | |
| void * | implData |
| Pointer to internal implementation data. | |
| class sce::Json::Array::iterator |
Class for iterating over Array members.
Public Member Functions | |
| iterator () | |
| iterator (const iterator &iter) | |
| ~iterator () | |
| void | advance (SceSize adv) |
| Advance the iterator by adv. | |
| iterator & | operator= (const iterator &iter) |
| Assignment operator. | |
| void | operator++ (int adv) |
| Advance the iterator by adv. | |
| void | operator++ () |
| Increment the iterator. | |
| Value & | operator* () const |
| Dereference the iterator. | |
| bool | operator!= (iterator iter) const |
| Compare to another iterator. | |
| Value * | operator-> () const |
| Access the Value being pointed to. | |
Private Attributes | |
| void * | implData |
| Pointer to internal implementation data. | |
| class sce::Json::String |
Class for JSON strings.
Public Member Functions | |
| String () | |
| String (const char *s) | |
| String (const String &str) | |
| ~String () | |
| String & | append (const char *s) |
| Append string s to the end. | |
| String & | append (const char *s, SceSize pos) |
| Append string s to position pos. | |
| String & | append (const String &str) |
| Append string str. | |
| String | substr (SceSize pos=0, SceSize len=npos) const |
| Returns a newly constructed string object with its value initialized to a copy of a substring of this object. | |
| char | at (SceSize pos) const |
| Returns the character found at pos. | |
| SceSize | find (const char *s, SceSize pos) const |
| Searches the string for the first instance of a sequence. | |
| SceSize | find (const char *s, SceSize pos, SceSize n) const |
| Searches the string for the first instance of a sequence. | |
| SceSize | find (const String &str, SceSize pos) const |
| Searches the string for the first instance of a sequence. | |
| SceSize | find (char c, SceSize pos) const |
| Searches the string for the first instance of a sequence. | |
| SceSize | rfind (const char *s, SceSize pos) const |
| Searches the string for the last instance of a sequence. | |
| SceSize | rfind (const char *s, SceSize pos, SceSize n) const |
| Searches the string for the last instance of a sequence. | |
| SceSize | rfind (const String &str, SceSize pos) const |
| Searches the string for the last instance of a sequence. | |
| SceSize | rfind (char c, SceSize pos) const |
| Searches the string for the last instance of a sequence. | |
| void | clear () |
| Clears the string's contents. | |
| bool | empty () const |
| Returns whether the string is empty or not. | |
| SceSize | size () const |
| Returns the length of the String in bytes. | |
| SceSize | length () const |
| Returns the length of the String in bytes. | |
| const char * | c_str () const |
| Returns a C style string buffer of the String. | |
| void | resize (SceSize n) |
| Resizes the string to a length of n characters. | |
| bool | compare (const char *s) const |
| Compares the string to s. | |
| bool | compare (const String &str) const |
| Compares the string to str. | |
| String & | operator+= (const char *s) |
| Appends s to the string. | |
| String & | operator+= (unsigned char c) |
| Appends c to the string. | |
| bool | operator== (const char *s) const |
| Compares the string to s. | |
| bool | operator== (const String &str) const |
| Compares the string to str. | |
| String & | operator= (const String &str) |
| Assignment Operator. | |
Static Public Attributes | |
| static const SceSize | npos = -1 |
Private Attributes | |
| void * | implData |
| Pointer to internal implementation data. | |
| class sce::Json::Value |
Class for value of JSON property.
Public Types | ||
| typedef int(* | SerializeCallback) (String &str, void *userData) | |
| Callback for serialization. | ||
| typedef Value const &(* | NullAccessCallback) (ValueType type, const Value *parent, void *userData) | |
| Callback for NullValue access. | ||
Public Member Functions | ||
| Value () | ||
| Value (ValueType type) | ||
| Value (SceBool value) | ||
| Value (SceInt64 value) | ||
| Value (SceUInt64 value) | ||
| Value (double value) | ||
| Value (const String &value) | ||
| Value (const Array &value) | ||
| Value (const Object &value) | ||
| Value (const Value &value) | ||
| ~Value () | ||
| void | toString (String &s) const | |
| Sets s to be a string representation of the value. | ||
| void | swap (Value &val) | |
| Swaps the value with another Value. | ||
| void | clear () | |
| Clears the value by setting to null. | ||
| SceSize | count () const | |
| Returns number of children. | ||
| ValueType | getType () const | |
| Returns the ValueType of the value. | ||
| void | set (ValueType type) | |
| Set the type. | ||
| void | set (bool value) | |
| Set the value to a boolean. | ||
| void | set (SceInt64 value) | |
| Set the value to a long integer(64 bits) | ||
| void | set (SceUInt64 value) | |
| Set the value to an unsigned long integer(64 bits) | ||
| void | set (double value) | |
| Set the value to a double precision float. | ||
| void | set (const String &value) | |
| Set the value to a String. | ||
| void | set (const Array &value) | |
| Set the value to an Array. | ||
| void | set (const Object &value) | |
| Set the value to an Object. | ||
| void | set (const Value &value) | |
| Set the value. | ||
| int | setNullAccessCallback (NullAccessCallback cb, void *userData) | |
| Set the Value's NullAccessCallback. | ||
| Value & | getRoot () const | |
| Returns a reference to the root Value. | ||
| const bool & | getBoolean () const | |
| Returns a constant reference to the value. | ||
| const SceInt64 & | getInteger () const | |
| Returns a constant reference to the value. | ||
| const SceUInt64 & | getUInteger () const | |
| Returns a constant reference to the value. | ||
| const SceDouble & | getReal () const | |
| Returns a constant reference to the value. | ||
| const String & | getString () const | |
| Returns a constant reference to the string. | ||
| const Array & | getArray () const | |
| Returns a constant reference to the array. | ||
| const Object & | getObject () const | |
| Returns a constant reference to the object. | ||
| const Value & | getValue (SceSize pos) const | |
| Returns a constant reference to the value. | ||
| const Value & | getValue (const String &key) const | |
| Returns a constant reference to the value. | ||
| SceBool * | referBoolean () | |
| Returns a pointer to the value. | ||
| SceInt64 * | referInteger () | |
| Returns a pointer to the value. | ||
| SceUInt64 * | referUInteger () | |
| Returns a pointer to the value. | ||
| SceDouble * | referReal () | |
| Returns a pointer to the value. | ||
| String * | referString () | |
| Returns a pointer to the string. | ||
| Array * | referArray () | |
| Returns a pointer to the array. | ||
| Object * | referObject () | |
| Returns a pointer to the object. | ||
| Value * | referValue (SceSize pos) | |
| Returns a pointer to the value. | ||
| Value * | referValue (const String &key) | |
| Returns a pointer to the value. | ||
| int | serialize (String &s) | |
| Serializes the data into a string in JSON format. | ||
| int | serialize (String &str, SerializeCallback cb, void *userData) | |
| Serializes the values into a string in JSON format. | ||
| const Value & | operator[] (const String &key) const | |
| Returns constant reference of the Value of key. | ||
| const Value & | operator[] (const char *key) const | |
| Returns constant reference of the Value of key. | ||
| const Value & | operator[] (SceSize pos) const | |
| Returns constant reference of the Value at pos. | ||
| Value & | operator= (const Value &value) | |
| Assignment Operator. | ||
| operator bool () const | ||
Private Attributes | ||
| Value * | parent | |
| Pointer to the value's parent. | ||
| NullAccessCallback | cb | |
| The value's NullAccessCallback. | ||
| union { | ||
| bool | boolean | |
| SceInt64 | integer | |
| SceUInt64 | uinteger | |
| SceDouble | real | |
| String * | string | |
| Array * | array | |
| Object * | object | |
| } | value | |
| Union of different value types. | ||
| char | unused [4] | |
| Unused. | ||
| ValueType | type | |
| The type of the value. | ||
| class sce::Json::Object |
Class for JSON objects.
Public Member Functions | |
| Object () | |
| Object (const Object &obj) | |
| ~Object () | |
| iterator | begin () const |
| Returns an iterator to the first child element. | |
| iterator | end () const |
| Returns an iterator to after the last child element. | |
| iterator | insert (const Pair &p) |
| Inserts a pair into the Object. | |
| iterator | find (const String &key) const |
| Finds a Pair with a matching key. | |
| void | clear () |
| Empty the object. | |
| void | erase (const String &str) |
| Remove the Pair with the key str. | |
| SceSize | size () const |
| Gets the number of child Pairs. | |
| bool | empty () const |
| Is the object empty? | |
| Value & | operator[] (const String &str) |
| Searches for a pair with a key matching str. | |
| Object & | operator= (const Object &obj) |
| Assignment Operator. | |
Private Attributes | |
| void * | implData |
| Pointer to internal implementation data. | |
| class sce::Json::Object::Pair |
| class sce::Json::Object::iterator |
Class for iterating over Object members.
Public Member Functions | |
| iterator () | |
| iterator (const iterator &iter) | |
| ~iterator () | |
| void | advance (SceSize adv) |
| Advance the iterator. | |
| iterator & | operator++ (int adv) |
| Increment the iterator. | |
| iterator & | operator++ () |
| Increment the iterator. | |
| Pair & | operator* () const |
| Dereference the iterator. | |
| bool | operator== (iterator iter) const |
| Compare to another iterator. | |
| bool | operator!= (iterator iter) const |
| Compare to another iterator. | |
| Pair * | operator-> () const |
| Access the Pair the iterator is pointing to. | |
| iterator & | operator= (const iterator &iter) |
| Assignment Operator. | |
Private Attributes | |
| void * | implData |
| Pointer to internal implementation data. | |
| class sce::Json::Parser |
Static Class for parsing.
Public Types | |
| typedef int(* | ParseCallback) (char &ch, void *userData) |
| Callback for outputing a character to parse. | |
Static Public Member Functions | |
| static int | parse (Value &val, ParseCallback cb, void *userData) |
| Parses user defined data using characters from a user defined callback function. | |
| static int | parse (Value &val, const char *buf, SceSize size) |
| Parses a string buffer. | |
| static int | parse (Value &val, const char *path) |
| Parse a JSON file. | |
| typedef int(* sce::Json::Value::SerializeCallback) (String &str, void *userData) |
Callback for serialization.
It is called at certain points in the serialization process.
| [in,out] | str | - The current state of the parser output. |
| [in] | userData | - User defined data for the function. |
| typedef Value const &(* sce::Json::Value::NullAccessCallback) (ValueType type, const Value *parent, void *userData) |
Callback for NullValue access.
It is called when the type of the Value is ValueType::NullValue and the Value is accessed.
| [in] | type | - The type of value requested. |
| [in] | parent | - A pointer to the parent of the Value accessed. |
| [in] | userData | - User defined data for the function. |
| typedef int(* sce::Json::Parser::ParseCallback) (char &ch, void *userData) |
Callback for outputing a character to parse.
| [out] | ch | - The character to be sent back to the parser. |
| [in] | userData | - User defined data for the function. |
| enum SceJsonErrorCode |
Enumerator of different errors in this library.
|
strong |
Strongly typed Enumerator of different types of Values.
| sce::Json::MemAllocator::MemAllocator | ( | ) |
|
virtual |
|
pure virtual |
Virtual Function for memory allocation.
| [in] | size | - Size of the allocated memory |
| [in] | data | - User defined data for the function. |
|
pure virtual |
Virtual Function for memory deallocation.
| [in] | ptr | - Pointer to memory. |
| [in] | data | - User defined data for the function. |
|
virtual |
The base class definition prints an error to sceClibPrintf.
| sce::Json::Initializer::Initializer | ( | ) |
| sce::Json::Initializer::~Initializer | ( | ) |
| int sce::Json::Initializer::initialize | ( | const InitParameter * | initParams | ) |
Initialise the library.
| [in] | initParams | - Initialisation parameters for the library. |
| int sce::Json::Initializer::terminate | ( | ) |
Terminate the library.
| sce::Json::Array::iterator::iterator | ( | ) |
| sce::Json::Array::iterator::iterator | ( | const iterator & | iter | ) |
| sce::Json::Array::iterator::~iterator | ( | ) |
| void sce::Json::Array::iterator::advance | ( | SceSize | adv | ) |
Advance the iterator by adv.
| void sce::Json::Array::iterator::operator++ | ( | int | adv | ) |
Advance the iterator by adv.
| void sce::Json::Array::iterator::operator++ | ( | ) |
Increment the iterator.
| Value & sce::Json::Array::iterator::operator* | ( | ) | const |
Dereference the iterator.
| bool sce::Json::Array::iterator::operator!= | ( | iterator | iter | ) | const |
Compare to another iterator.
| [in] | iter | - The iterator to compare to. |
| sce::Json::Array::Array | ( | ) |
| sce::Json::Array::Array | ( | const Array & | arr | ) |
| sce::Json::Array::~Array | ( | ) |
| iterator sce::Json::Array::begin | ( | ) | const |
Get an iterator pointing to the start of the Array.
| iterator sce::Json::Array::end | ( | ) | const |
Get an iterator pointing to after the end of the Array.
| Value & sce::Json::Array::back | ( | ) | const |
Returns a reference to the last element in the Array.
| void sce::Json::Array::clear | ( | ) |
Will empty the Array, removing all child values.
| void sce::Json::Array::pop_back | ( | ) |
Removes the last child value.
| SceSize sce::Json::Array::size | ( | ) | const |
Get the size of the array.
| bool sce::Json::Array::empty | ( | ) | const |
Is the array empty.
| sce::Json::String::String | ( | ) |
| sce::Json::String::String | ( | const char * | s | ) |
| sce::Json::String::String | ( | const String & | str | ) |
| sce::Json::String::~String | ( | ) |
| String & sce::Json::String::append | ( | const char * | s | ) |
Append string s to the end.
| [in] | s | - Pointer to the C string to append. |
Append string s to position pos.
| [in] | s | - Pointer to the C string to append. |
| [in] | pos | - Position in the String to append to. |
Returns a newly constructed string object with its value initialized to a copy of a substring of this object.
| [in] | pos | - The starting position of the sub-string. |
| [in] | len | - The length of the sub-string. |
| char sce::Json::String::at | ( | SceSize | pos | ) | const |
Returns the character found at pos.
| [in] | pos | - The position of the desired character. |
Searches the string for the first instance of a sequence.
| [in] | s | - The sequence to search for. |
| [in] | pos | - Position to start searching from. |
Searches the string for the first instance of a sequence.
| [in] | s | - The sequence to search for. |
| [in] | pos | - Position to start searching from. |
| [in] | n | - Length of the sequence. |
Searches the string for the first instance of a sequence.
| [in] | str | - The sequence to search for. |
| [in] | pos | - Position to start searching from. |
Searches the string for the first instance of a sequence.
| [in] | c | - The sequence to search for. |
| [in] | pos | - Position to start searching from. |
Searches the string for the last instance of a sequence.
| [in] | s | - The sequence to search for. |
| [in] | pos | - Position to start searching from. |
Searches the string for the last instance of a sequence.
| [in] | s | - The sequence to search for. |
| [in] | pos | - Position to start searching from. |
| [in] | n | - Length of the sequence. |
Searches the string for the last instance of a sequence.
| [in] | str | - The sequence to search for. |
| [in] | pos | - Position to start searching from. |
Searches the string for the last instance of a sequence.
| [in] | c | - The sequence to search for. |
| [in] | pos | - Position to start searching from. |
| void sce::Json::String::clear | ( | ) |
Clears the string's contents.
| bool sce::Json::String::empty | ( | ) | const |
Returns whether the string is empty or not.
| SceSize sce::Json::String::size | ( | ) | const |
Returns the length of the String in bytes.
| SceSize sce::Json::String::length | ( | ) | const |
Returns the length of the String in bytes.
| const char * sce::Json::String::c_str | ( | ) | const |
Returns a C style string buffer of the String.
| void sce::Json::String::resize | ( | SceSize | n | ) |
Resizes the string to a length of n characters.
| bool sce::Json::String::compare | ( | const char * | s | ) | const |
Compares the string to s.
| bool sce::Json::String::compare | ( | const String & | str | ) | const |
Compares the string to str.
| String & sce::Json::String::operator+= | ( | const char * | s | ) |
Appends s to the string.
| String & sce::Json::String::operator+= | ( | unsigned char | c | ) |
Appends c to the string.
| bool sce::Json::String::operator== | ( | const char * | s | ) | const |
Compares the string to s.
| bool sce::Json::String::operator== | ( | const String & | str | ) | const |
Compares the string to str.
| sce::Json::Value::Value | ( | ) |
| sce::Json::Value::Value | ( | ValueType | type | ) |
| sce::Json::Value::Value | ( | SceBool | value | ) |
| sce::Json::Value::Value | ( | SceInt64 | value | ) |
| sce::Json::Value::Value | ( | SceUInt64 | value | ) |
| sce::Json::Value::Value | ( | double | value | ) |
| sce::Json::Value::Value | ( | const String & | value | ) |
| sce::Json::Value::Value | ( | const Array & | value | ) |
| sce::Json::Value::Value | ( | const Object & | value | ) |
| sce::Json::Value::Value | ( | const Value & | value | ) |
| sce::Json::Value::~Value | ( | ) |
| void sce::Json::Value::toString | ( | String & | s | ) | const |
Sets s to be a string representation of the value.
| [out] | s | - The resultant string |
| void sce::Json::Value::swap | ( | Value & | val | ) |
| void sce::Json::Value::clear | ( | ) |
Clears the value by setting to null.
| SceSize sce::Json::Value::count | ( | ) | const |
Returns number of children.
| ValueType sce::Json::Value::getType | ( | ) | const |
Returns the ValueType of the value.
| void sce::Json::Value::set | ( | ValueType | type | ) |
Set the type.
| [in] | type | - The type to set the value to. |
| void sce::Json::Value::set | ( | bool | value | ) |
Set the value to a boolean.
| [in] | value | - New value |
| void sce::Json::Value::set | ( | SceInt64 | value | ) |
Set the value to a long integer(64 bits)
| [in] | value | - New value |
| void sce::Json::Value::set | ( | SceUInt64 | value | ) |
Set the value to an unsigned long integer(64 bits)
| [in] | value | - new value |
| void sce::Json::Value::set | ( | double | value | ) |
Set the value to a double precision float.
| [in] | value | - New value |
| void sce::Json::Value::set | ( | const String & | value | ) |
| void sce::Json::Value::set | ( | const Array & | value | ) |
| void sce::Json::Value::set | ( | const Object & | value | ) |
| void sce::Json::Value::set | ( | const Value & | value | ) |
Set the value.
| [in] | value | - Value to copy from. |
| int sce::Json::Value::setNullAccessCallback | ( | NullAccessCallback | cb, |
| void * | userData | ||
| ) |
Set the Value's NullAccessCallback.
| [in] | cb | - The callback. |
| [in] | data | - Data to pass to the callback function. |
| Value & sce::Json::Value::getRoot | ( | ) | const |
Returns a reference to the root Value.
| const bool & sce::Json::Value::getBoolean | ( | ) | const |
Returns a constant reference to the value.
| const SceInt64 & sce::Json::Value::getInteger | ( | ) | const |
Returns a constant reference to the value.
| const SceUInt64 & sce::Json::Value::getUInteger | ( | ) | const |
Returns a constant reference to the value.
| const SceDouble & sce::Json::Value::getReal | ( | ) | const |
Returns a constant reference to the value.
| const String & sce::Json::Value::getString | ( | ) | const |
Returns a constant reference to the string.
Only constant functions can be used, and the string cannot be altered.
referString() is the alternative function for altering the string.
| const Array & sce::Json::Value::getArray | ( | ) | const |
Returns a constant reference to the array.
Only constant functions can be used, and the array and its members cannot be altered.
referArray() is the alternative function for altering the array.
| const Object & sce::Json::Value::getObject | ( | ) | const |
Returns a constant reference to the object.
Only constant functions can be used, and the object and its members cannot be altered.
referObject() is the alternative function for altering the array.
Returns a constant reference to the value.
Only constant functions can be used, and the value cannot be altered.
referValue(SceSize) is the alternative function for altering the value.
| [in] | pos | - The position of the value. |
Returns a constant reference to the value.
Only constant functions can be used, and the value cannot be altered.
referValue(const String&) is the alternative function for altering the value.
| [in] | key | - The key of the value. |
| SceBool * sce::Json::Value::referBoolean | ( | ) |
Returns a pointer to the value.
| SceInt64 * sce::Json::Value::referInteger | ( | ) |
Returns a pointer to the value.
| SceUInt64 * sce::Json::Value::referUInteger | ( | ) |
Returns a pointer to the value.
| SceDouble * sce::Json::Value::referReal | ( | ) |
Returns a pointer to the value.
| String * sce::Json::Value::referString | ( | ) |
Returns a pointer to the string.
getString() is the alternative function for only reading the string.
| Array * sce::Json::Value::referArray | ( | ) |
Returns a pointer to the array.
getArray() is the alternative function for only reading the array.
| Object * sce::Json::Value::referObject | ( | ) |
Returns a pointer to the object.
getObject() is the alternative function for only reading the object.
Returns a pointer to the value.
getValue(SceSize) is the alternative function for only reading the Value.
| [in] | pos | - The position of the value. |
Returns a pointer to the value.
getValue(String&) is the alternative function for only reading the Value.
| [in] | key | - The key of the value. |
| int sce::Json::Value::serialize | ( | String & | s | ) |
Serializes the data into a string in JSON format.
| [out] | s | - The resulting string, can be written to a file or parsed. |
| int sce::Json::Value::serialize | ( | String & | str, |
| SerializeCallback | cb, | ||
| void * | userData | ||
| ) |
Serializes the values into a string in JSON format.
Allows for a callback for the different stages in the serialization.
| [in,out] | s | - The resulting string, can be written to a file or parsed again. |
| [in] | cb | - Callback for the internal serialization. Can be used to format the output string, as the string is not formatted internally. |
| [in] | userData | - User defined data passed to the SerializeCallback |
| const Value & sce::Json::Value::operator[] | ( | const char * | key | ) | const |
| sce::Json::Value::operator bool | ( | ) | const |
| sce::Json::Object::Pair::Pair | ( | ) |
| sce::Json::Object::Pair::~Pair | ( | ) |
| sce::Json::Object::iterator::iterator | ( | ) |
| sce::Json::Object::iterator::iterator | ( | const iterator & | iter | ) |
| sce::Json::Object::iterator::~iterator | ( | ) |
| void sce::Json::Object::iterator::advance | ( | SceSize | adv | ) |
Advance the iterator.
| [in] | adv | - Number by which to advance. |
| iterator & sce::Json::Object::iterator::operator++ | ( | int | adv | ) |
Increment the iterator.
| [in] | adv | - The amount to increment it by. |
| iterator & sce::Json::Object::iterator::operator++ | ( | ) |
Increment the iterator.
| Pair & sce::Json::Object::iterator::operator* | ( | ) | const |
Dereference the iterator.
| bool sce::Json::Object::iterator::operator== | ( | iterator | iter | ) | const |
Compare to another iterator.
| bool sce::Json::Object::iterator::operator!= | ( | iterator | iter | ) | const |
Compare to another iterator.
| Pair * sce::Json::Object::iterator::operator-> | ( | ) | const |
Access the Pair the iterator is pointing to.
| sce::Json::Object::Object | ( | ) |
| sce::Json::Object::Object | ( | const Object & | obj | ) |
| sce::Json::Object::~Object | ( | ) |
| iterator sce::Json::Object::begin | ( | ) | const |
Returns an iterator to the first child element.
| iterator sce::Json::Object::end | ( | ) | const |
Returns an iterator to after the last child element.
| void sce::Json::Object::clear | ( | ) |
Empty the object.
| void sce::Json::Object::erase | ( | const String & | str | ) |
| SceSize sce::Json::Object::size | ( | ) | const |
Gets the number of child Pairs.
| bool sce::Json::Object::empty | ( | ) | const |
Is the object empty?
Searches for a pair with a key matching str.
|
static |
Parses user defined data using characters from a user defined callback function.
| [out] | val | - Reference to the value the data is written to. |
| [in] | cb | - The callback function which gives the current character. |
| [in] | data | - Data to pass to the callback function |
|
static |
Parse a JSON file.
Will parse until EOF.
| [out] | val | - Reference to the Value the data is written to. |
| [in] | path | - Path to the JSON file. |
| MemAllocator* sce::Json::InitParameter::allocator |
Pointer to a MemAllocator object for internal memory allocations.
Required field.
| void* sce::Json::InitParameter::userData |
User defined data sent to overriden MemAllocator functions.
| SceSize sce::Json::InitParameter::bufSize |
Size of the buffer used for reading JSON file data in Parser::parse(Value&, const char*).
Does not have to be the size of the file, but a smaller buffer size will result in more IO calls.
|
private |
Pointer to internal implementation data.
|
private |
Pointer to internal implementation data.
|
static |
|
private |
Pointer to internal implementation data.
|
private |
Pointer to the value's parent.
|
private |
The value's NullAccessCallback.
| bool { ... } ::boolean |
| SceInt64 { ... } ::integer |
| SceUInt64 { ... } ::uinteger |
| SceDouble { ... } ::real |
| String* { ... } ::string |
| Array* { ... } ::array |
| Object* { ... } ::object |
| union { ... } sce::Json::Value::value |
Union of different value types.
|
private |
Unused.
|
private |
The type of the value.
| String sce::Json::Object::Pair::key |
Name assigned to the property.
| char sce::Json::Object::Pair::unused[4] |
Unused.
|
private |
Pointer to internal implementation data.
|
private |
Pointer to internal implementation data.