The C++ framework for developing highly scalable, high performance servers on Windows platforms.

Json Namespace Reference


Detailed Description

Json-cpp amalgated source (http://jsoncpp.sourceforge.net/). It is intented to be used with include <json/json.h>.

JSON (JavaScript Object Notation).


Classes

class  Features
class  StaticString
class  Value
class  PathArgument
class  Path
class  ValueIteratorBase
class  ValueConstIterator
class  ValueIterator
class  Reader
class  CharReader
 Interface for reading JSON from a char array. More...
class  CharReaderBuilder
class  StreamWriter
 Usage:. More...
class  StreamWriterBuilder
class  Writer
class  FastWriter
class  StyledWriter
class  StyledStreamWriter

Typedefs

typedef int Int
typedef unsigned int UInt
typedef __int64 Int64
typedef unsigned __int64 UInt64
typedef Int64 LargestInt
typedef UInt64 LargestUInt
typedef unsigned int ArrayIndex
typedef int Int
typedef unsigned int UInt
typedef __int64 Int64
typedef unsigned __int64 UInt64
typedef Int64 LargestInt
typedef UInt64 LargestUInt
typedef unsigned int ArrayIndex
typedef char UIntToStringBuffer [uintToStringBufferSize]
typedef
std::auto_ptr
< CharReader
CharReaderPtr
typedef
std::auto_ptr
< StreamWriter
StreamWriterPtr
typedef int Int
typedef unsigned int UInt
typedef __int64 Int64
typedef unsigned __int64 UInt64
typedef Int64 LargestInt
typedef UInt64 LargestUInt
typedef unsigned int ArrayIndex
typedef
std::auto_ptr
< CharReader
CharReaderPtr
typedef char UIntToStringBuffer [uintToStringBufferSize]
typedef
std::auto_ptr
< StreamWriter
StreamWriterPtr
typedef int Int
typedef unsigned int UInt
typedef __int64 Int64
typedef unsigned __int64 UInt64
typedef Int64 LargestInt
typedef UInt64 LargestUInt
typedef unsigned int ArrayIndex

Enumerations

enum  ValueType {
  nullValue = 0, nullValue = 0, intValue, intValue,
  uintValue, uintValue, realValue, realValue,
  stringValue, stringValue, booleanValue, booleanValue,
  arrayValue, arrayValue, objectValue, objectValue,
  nullValue = 0, nullValue = 0, intValue, intValue,
  uintValue, uintValue, realValue, realValue,
  stringValue, stringValue, booleanValue, booleanValue,
  arrayValue, arrayValue, objectValue, objectValue
}
enum  CommentPlacement {
  commentBefore = 0, commentBefore = 0, commentAfterOnSameLine, commentAfterOnSameLine,
  commentAfter, commentAfter, numberOfCommentPlacement, numberOfCommentPlacement,
  commentBefore = 0, commentBefore = 0, commentAfterOnSameLine, commentAfterOnSameLine,
  commentAfter, commentAfter, numberOfCommentPlacement, numberOfCommentPlacement
}
enum  { uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1, uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 }
enum  ValueType {
  nullValue = 0, nullValue = 0, intValue, intValue,
  uintValue, uintValue, realValue, realValue,
  stringValue, stringValue, booleanValue, booleanValue,
  arrayValue, arrayValue, objectValue, objectValue,
  nullValue = 0, nullValue = 0, intValue, intValue,
  uintValue, uintValue, realValue, realValue,
  stringValue, stringValue, booleanValue, booleanValue,
  arrayValue, arrayValue, objectValue, objectValue
}
enum  CommentPlacement {
  commentBefore = 0, commentBefore = 0, commentAfterOnSameLine, commentAfterOnSameLine,
  commentAfter, commentAfter, numberOfCommentPlacement, numberOfCommentPlacement,
  commentBefore = 0, commentBefore = 0, commentAfterOnSameLine, commentAfterOnSameLine,
  commentAfter, commentAfter, numberOfCommentPlacement, numberOfCommentPlacement
}
enum  { uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1, uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 }

Functions

bool parseFromStream (CharReader::Factory const &, std::istream &, Value *root, std::string *errs)
 Consume entire stream and use its begin/end.
JSON_API std::istream & operator>> (std::istream &, Value &)
std::string writeString (StreamWriter::Factory const &factory, Value const &root)
std::string JSON_API valueToString (Int value)
std::string JSON_API valueToString (UInt value)
std::string JSON_API valueToString (LargestInt value)
std::string JSON_API valueToString (LargestUInt value)
std::string JSON_API valueToString (double value)
std::string JSON_API valueToString (bool value)
std::string JSON_API valueToQuotedString (const char *value)
JSON_API std::ostream & operator<< (std::ostream &, const Value &root)
static std::string codePointToUTF8 (unsigned int cp)
 Converts a unicode code-point to UTF-8.
static bool isControlCharacter (char ch)
 Returns true if ch is a control character (in range [0,32[).
static void uintToString (LargestUInt value, char *&current)
 Converts an unsigned integer to string.
static void fixNumericLocale (char *begin, char *end)
 Change ',' to '.
static bool containsNewLine (Reader::Location begin, Reader::Location end)
static std::string normalizeEOL (Reader::Location begin, Reader::Location end)
static void getValidReaderKeys (std::set< std::string > *valid_keys)
static const
unsigned char 
ALIGNAS (8) kNull[sizeof(Value)]
template<typename T, typename U>
static bool InRange (double d, T min, U max)
static char * duplicateStringValue (const char *value, unsigned int length=unknown)
 Duplicates the specified string value.
static void releaseStringValue (char *value)
 Free the string duplicated by duplicateStringValue().
static bool IsIntegral (double d)
static bool containsControlCharacter (const char *str)
static void getValidWriterKeys (std::set< std::string > *valid_keys)

Variables

static const Value null
const unsigned char & kNullRef = kNull[0]
static const unsigned int unknown = (unsigned)-1
 Unknown size marker.
static const Value null
const unsigned char & kNullRef = kNull[0]
static const unsigned int unknown = (unsigned)-1
 Unknown size marker.


Typedef Documentation

typedef unsigned int ArrayIndex

typedef unsigned int ArrayIndex

typedef unsigned int ArrayIndex

typedef unsigned int ArrayIndex

typedef std::auto_ptr<CharReader> CharReaderPtr

typedef std::auto_ptr<CharReader> CharReaderPtr

typedef int Int

typedef int Int

typedef int Int

typedef int Int

typedef __int64 Int64

typedef __int64 Int64

typedef __int64 Int64

typedef __int64 Int64

typedef Int64 LargestInt

typedef Int64 LargestInt

typedef Int64 LargestInt

typedef Int64 LargestInt

typedef std::auto_ptr<StreamWriter> StreamWriterPtr

typedef std::auto_ptr<StreamWriter> StreamWriterPtr

typedef unsigned int UInt

typedef unsigned int UInt

typedef unsigned int UInt

typedef unsigned int UInt

typedef unsigned __int64 UInt64

typedef unsigned __int64 UInt64

typedef unsigned __int64 UInt64

typedef unsigned __int64 UInt64

typedef char UIntToStringBuffer[uintToStringBufferSize]

typedef char UIntToStringBuffer[uintToStringBufferSize]


Enumeration Type Documentation

anonymous enum

Enumerator:
uintToStringBufferSize  Constant that specify the size of the buffer that must be passed to uintToString.
uintToStringBufferSize  Constant that specify the size of the buffer that must be passed to uintToString.

anonymous enum

Enumerator:
uintToStringBufferSize  Constant that specify the size of the buffer that must be passed to uintToString.
uintToStringBufferSize  Constant that specify the size of the buffer that must be passed to uintToString.

Enumerator:
commentBefore  a comment placed on the line before a value
commentBefore  a comment placed on the line before a value
commentAfterOnSameLine  a comment just after a value on the same line
commentAfterOnSameLine  a comment just after a value on the same line
commentAfter  a comment on the line after a value (only make sense for root value)
commentAfter  a comment on the line after a value (only make sense for root value)
numberOfCommentPlacement 
numberOfCommentPlacement 
commentBefore  a comment placed on the line before a value
commentBefore  a comment placed on the line before a value
commentAfterOnSameLine  a comment just after a value on the same line
commentAfterOnSameLine  a comment just after a value on the same line
commentAfter  a comment on the line after a value (only make sense for root value)
commentAfter  a comment on the line after a value (only make sense for root value)
numberOfCommentPlacement 
numberOfCommentPlacement 

Enumerator:
commentBefore  a comment placed on the line before a value
commentBefore  a comment placed on the line before a value
commentAfterOnSameLine  a comment just after a value on the same line
commentAfterOnSameLine  a comment just after a value on the same line
commentAfter  a comment on the line after a value (only make sense for root value)
commentAfter  a comment on the line after a value (only make sense for root value)
numberOfCommentPlacement 
numberOfCommentPlacement 
commentBefore  a comment placed on the line before a value
commentBefore  a comment placed on the line before a value
commentAfterOnSameLine  a comment just after a value on the same line
commentAfterOnSameLine  a comment just after a value on the same line
commentAfter  a comment on the line after a value (only make sense for root value)
commentAfter  a comment on the line after a value (only make sense for root value)
numberOfCommentPlacement 
numberOfCommentPlacement 

enum ValueType

Type of the value held by a Value object.

Enumerator:
nullValue  'null' value
nullValue  'null' value
intValue  signed integer value
intValue  signed integer value
uintValue  unsigned integer value
uintValue  unsigned integer value
realValue  double value
realValue  double value
stringValue  UTF-8 string value.
stringValue  UTF-8 string value.
booleanValue  bool value
booleanValue  bool value
arrayValue  array value (ordered list)
arrayValue  array value (ordered list)
objectValue  object value (collection of name/value pairs).
objectValue  object value (collection of name/value pairs).
nullValue  'null' value
nullValue  'null' value
intValue  signed integer value
intValue  signed integer value
uintValue  unsigned integer value
uintValue  unsigned integer value
realValue  double value
realValue  double value
stringValue  UTF-8 string value.
stringValue  UTF-8 string value.
booleanValue  bool value
booleanValue  bool value
arrayValue  array value (ordered list)
arrayValue  array value (ordered list)
objectValue  object value (collection of name/value pairs).
objectValue  object value (collection of name/value pairs).

enum ValueType

Type of the value held by a Value object.

Enumerator:
nullValue  'null' value
nullValue  'null' value
intValue  signed integer value
intValue  signed integer value
uintValue  unsigned integer value
uintValue  unsigned integer value
realValue  double value
realValue  double value
stringValue  UTF-8 string value.
stringValue  UTF-8 string value.
booleanValue  bool value
booleanValue  bool value
arrayValue  array value (ordered list)
arrayValue  array value (ordered list)
objectValue  object value (collection of name/value pairs).
objectValue  object value (collection of name/value pairs).
nullValue  'null' value
nullValue  'null' value
intValue  signed integer value
intValue  signed integer value
uintValue  unsigned integer value
uintValue  unsigned integer value
realValue  double value
realValue  double value
stringValue  UTF-8 string value.
stringValue  UTF-8 string value.
booleanValue  bool value
booleanValue  bool value
arrayValue  array value (ordered list)
arrayValue  array value (ordered list)
objectValue  object value (collection of name/value pairs).
objectValue  object value (collection of name/value pairs).


Function Documentation

static const unsigned char Json::ALIGNAS (  )  [static]

static std::string Json::codePointToUTF8 ( unsigned int  cp  )  [inline, static]

Converts a unicode code-point to UTF-8.

static bool Json::containsControlCharacter ( const char *  str  )  [static]

static bool Json::containsNewLine ( Reader::Location  begin,
Reader::Location  end 
) [static]

static char* Json::duplicateStringValue ( const char *  value,
unsigned int  length = unknown 
) [inline, static]

Duplicates the specified string value.

Parameters:
value Pointer to the string to duplicate. Must be zero-terminated if length is "unknown".
length Length of the value. if equals to unknown, then it will be computed using strlen(value).
Returns:
Pointer on the duplicate instance of string.

static void Json::fixNumericLocale ( char *  begin,
char *  end 
) [inline, static]

Change ',' to '.

' everywhere in buffer.

We had a sophisticated way, but it did not work in WinCE.

See also:
https://github.com/open-source-parsers/jsoncpp/pull/9

static void Json::getValidReaderKeys ( std::set< std::string > *  valid_keys  )  [static]

static void Json::getValidWriterKeys ( std::set< std::string > *  valid_keys  )  [static]

static bool Json::InRange ( double  d,
min,
max 
) [inline, static]

static bool Json::isControlCharacter ( char  ch  )  [inline, static]

Returns true if ch is a control character (in range [0,32[).

static bool Json::IsIntegral ( double  d  )  [static]

static std::string Json::normalizeEOL ( Reader::Location  begin,
Reader::Location  end 
) [static]

std::ostream & operator<< ( std::ostream &  sout,
const Value &  root 
)

Output using the StyledStreamWriter.

See also:
Json::operator>>()

std::istream & operator>> ( std::istream &  sin,
Value &  root 
)

Read from 'sin' into 'root'.

Always keep comments from the input JSON.

This can be used to read a file into a particular sub-object. For example:

 Json::Value root;
 cin >> root["dir"]["file"];
 cout << root;
Result:
 {
 "dir": {
     "file": {
     // The input stream JSON would be nested here.
     }
 }
 }
 
Exceptions:
std::exception on parse error.
See also:
Json::operator<<()

bool parseFromStream ( CharReader::Factory const &  fact,
std::istream &  sin,
Value *  root,
std::string *  errs 
)

Consume entire stream and use its begin/end.

Someday we might have a real StreamReader, but for now this is convenient.

static void Json::releaseStringValue ( char *  value  )  [inline, static]

Free the string duplicated by duplicateStringValue().

static void Json::uintToString ( LargestUInt  value,
char *&  current 
) [inline, static]

Converts an unsigned integer to string.

Parameters:
value Unsigned interger to convert to string
current Input/Output string buffer. Must have at least uintToStringBufferSize chars free.

std::string valueToQuotedString ( const char *  value  ) 

std::string valueToString ( bool  value  ) 

std::string valueToString ( double  value  ) 

std::string valueToString ( LargestUInt  value  ) 

std::string valueToString ( LargestInt  value  ) 

std::string JSON_API Json::valueToString ( UInt  value  ) 

std::string JSON_API valueToString ( Int  value  ) 

std::string writeString ( StreamWriter::Factory const &  factory,
Value const &  root 
)

Write into stringstream, then return string, for convenience. A StreamWriter will be created from the factory, used, and then deleted.


Variable Documentation

const unsigned char& kNullRef = kNull[0]

const unsigned char& kNullRef = kNull[0]

const Value null [static]

const Value null [static]

const unsigned int unknown = (unsigned)-1 [static]

Unknown size marker.

const unsigned int unknown = (unsigned)-1 [static]

Unknown size marker.


Generated on Sun Sep 12 19:11:57 2021 for The Server Framework - v7.4 by doxygen 1.5.3