oos::json_string Class Reference

Class representing the json string type. More...

#include <json_string.hpp>

Inherits oos::json_type.

Public Member Functions

 json_string (const std::string &val)
 
 json_string (const json_value &x)
 
 json_string (const char *val)
 
 json_string (const json_string &x)
 
json_stringoperator= (const json_string &x)
 
json_stringoperator= (const json_value &x)
 
json_stringoperator= (const std::string &x)
 
bool operator< (const json_string &x) const
 
virtual bool parse (std::istream &in)
 
virtual void print (std::ostream &out) const
 
std::string value () const
 
void value (const std::string &val)
 
void push_back (char c)
 
- 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

Class representing the json string type.

This class represents the json string type.

Constructor & Destructor Documentation

oos::json_string::json_string ( const std::string &  val)

Creates a new json_string and initializes the value with the given string.

Parameters
valThe string to set.
oos::json_string::json_string ( const json_value x)

Creates a new json_string and initializes the value with the given json_value.

Parameters
xThe json_value to set.
oos::json_string::json_string ( const char *  val)

Creates a new json_string and initializes the value with the given string.

Parameters
valThe string to set.
oos::json_string::json_string ( const json_string x)

Creates a new json_string and initializes the value from the given json_string.

Parameters
xThe json_string to set.

Member Function Documentation

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

Less operator for json_string. Internaly the less operator of std::string is used.

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

Assign from a json_string

Parameters
xThe json_string to assign from.
Returns
This.
json_string& oos::json_string::operator= ( const json_value x)

Assign from a json_value

Parameters
xThe json_value to assign from.
Returns
This.
json_string& oos::json_string::operator= ( const std::string &  x)

Assign from a std::string

Parameters
xThe std::string to assign from.
Returns
This.
virtual bool oos::json_string::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_string::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.

void oos::json_string::push_back ( char  c)

Append a new to the current json_string

Parameters
cThe character to append.
std::string oos::json_string::value ( ) const

Return the current value.

Returns
The current value.
void oos::json_string::value ( const std::string &  val)

Set a new value.

Parameters
valThe new value to set.

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