CMSC23700 Common Code Library
Support code for CS23700 programming projects
JSON::Value Class Referenceabstract

#include <json.hxx>

Inherited by JSON::Array, JSON::Bool, JSON::Null, JSON::Number, JSON::Object, and JSON::String.

Public Member Functions

Type type () const
 return the type of this JSON value More...
 
bool isObject () const
 return true if this value is an object More...
 
bool isArray () const
 return true if this value is an array More...
 
bool isNumber () const
 return true if this value is a number More...
 
bool isString () const
 return true if this value is a string More...
 
bool isBool () const
 return true if this value is a boolean More...
 
bool isNull () const
 return true if this value is the null value More...
 
const ObjectasObject () const
 dynamic cast to JSON object More...
 
const ArrayasArray () const
 dynamic cast to JSON object More...
 
const NumberasNumber () const
 dynamic cast to JSON object More...
 
const StringasString () const
 dynamic cast to JSON object More...
 
const BoolasBool () const
 dynamic cast to JSON object More...
 
virtual ~Value ()=0
 
virtual std::string toString ()=0
 

Protected Member Functions

 Value (Type ty)
 

Protected Attributes

Type _ty
 

Constructor & Destructor Documentation

virtual JSON::Value::~Value ( )
pure virtual
JSON::Value::Value ( Type  ty)
inlineexplicitprotected

Member Function Documentation

const Array* JSON::Value::asArray ( ) const

dynamic cast to JSON object

const Bool* JSON::Value::asBool ( ) const

dynamic cast to JSON object

const Number* JSON::Value::asNumber ( ) const

dynamic cast to JSON object

const Object* JSON::Value::asObject ( ) const

dynamic cast to JSON object

const String* JSON::Value::asString ( ) const

dynamic cast to JSON object

bool JSON::Value::isArray ( ) const
inline

return true if this value is an array

bool JSON::Value::isBool ( ) const
inline

return true if this value is a boolean

bool JSON::Value::isNull ( ) const
inline

return true if this value is the null value

bool JSON::Value::isNumber ( ) const
inline

return true if this value is a number

bool JSON::Value::isObject ( ) const
inline

return true if this value is an object

bool JSON::Value::isString ( ) const
inline

return true if this value is a string

virtual std::string JSON::Value::toString ( )
pure virtual
Type JSON::Value::type ( ) const
inline

return the type of this JSON value

Member Data Documentation

Type JSON::Value::_ty
protected

The documentation for this class was generated from the following file: