oos::json_number Class Reference

Representing json number type. More...

#include <json_number.hpp>

Inherits oos::json_type.

Public Member Functions

 json_number (double val)
 
 json_number (const json_number &x)
 
 json_number (const json_value &x)
 
json_numberoperator= (const json_number &x)
 
json_numberoperator= (double val)
 
json_numberoperator= (const json_value &x)
 
bool operator< (const json_number &x) const
 
virtual bool parse (std::istream &in)
 
virtual void print (std::ostream &out) const
 
double value () const
 
void value (double val)
 
- Public Member Functions inherited from oos::json_type
virtual json_valueoperator[] (const std::string &key)
 
virtual json_valueoperator[] (size_t index)
 
virtual const json_valueoperator[] (size_t index) const
 
virtual void push_back (const json_value &x)
 
virtual size_t size () const
 
std::string type () const
 

Additional Inherited Members

- Protected Member Functions inherited from oos::json_type
 json_type (const std::string &name)
 
void type (const std::string &type)
 
- Static Protected Attributes inherited from oos::json_type
static json_parser parser
 

Detailed Description

Representing json number type.

Constructor & Destructor Documentation

oos::json_number::json_number ( double  val)

Create a new json_number value and initialize it with the given value.

Parameters
valThe value of json_bool.
oos::json_number::json_number ( const json_number x)

Copy from given json_number.

Parameters
xThe json_number to copy from.
oos::json_number::json_number ( const json_value x)

Copy from given json_value.

Parameters
xThe json_value to copy from.

Member Function Documentation

bool oos::json_number::operator< ( const json_number x) const

Less operator for json_number.

Parameters
xThe json_number to compare with.
Returns
True if this is less than x.
json_number& oos::json_number::operator= ( const json_number x)

Assign from given json_number.

Parameters
xThe json_number to assign from.
Returns
Initialized json_number.
json_number& oos::json_number::operator= ( double  val)

Assign from given number.

Parameters
valThe number to assign from.
Returns
Initialized json_number.
json_number& oos::json_number::operator= ( const json_value x)

Assign from given json_value.

Parameters
xThe json_value to assign from.
Returns
Initialized json_number.
virtual bool oos::json_number::parse ( std::istream &  in)
virtual

Parses in json input stream

Parameters
inThe json input stream
Returns
True if stream was parsed correctly

Implements oos::json_type.

virtual void oos::json_number::print ( std::ostream &  out) const
virtual

Prints the json type (tree) to a output stream.

Parameters
outThe stream to write on.

Implements oos::json_type.

double oos::json_number::value ( ) const

Return the current value.

Returns
The current value.
void oos::json_number::value ( double  val)

Set a new json_number value.

Parameters
valThe value to set.

The documentation for this class was generated from the following file:
  • json/json_number.hpp