oos::json_bool Class Reference

Class representing the json bool type. More...

#include <json_bool.hpp>

Inherits oos::json_type.

Public Member Functions

 json_bool (bool val)
 
virtual bool parse (std::istream &in)
 
virtual void print (std::ostream &out) const
 
bool value () const
 
void value (bool 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

Class representing the json bool type.

This class represents the json bool type.

Constructor & Destructor Documentation

oos::json_bool::json_bool ( bool  val)

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

Parameters
valThe value of json_bool.

Member Function Documentation

virtual bool oos::json_bool::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_bool::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.

bool oos::json_bool::value ( ) const

Return the current value.

Returns
The current value.
void oos::json_bool::value ( bool  val)

Set a new bool value.

Parameters
valThe new bool value.

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