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_string & | operator= (const json_string &x) |
json_string & | operator= (const json_value &x) |
json_string & | operator= (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_value & | operator[] (const std::string &key) |
virtual json_value & | operator[] (size_t index) |
virtual const json_value & | operator[] (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
-
val The 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
-
x The 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
-
val The 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
-
x The 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
-
x The json_string to compare with.
- Returns
- True if this is less than x.
json_string& oos::json_string::operator= | ( | const json_string & | x | ) |
json_string& oos::json_string::operator= | ( | const json_value & | x | ) |
json_string& oos::json_string::operator= | ( | const std::string & | x | ) |
Assign from a std::string
- Parameters
-
x The std::string to assign from.
- Returns
- This.
|
virtual |
Parses in json input stream
- Parameters
-
in The json input stream
- Returns
- True if stream was parsed correctly
Implements oos::json_type.
|
virtual |
Prints the json type (tree) to a output stream.
- Parameters
-
out The 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
-
c The 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
-
val The new value to set.
The documentation for this class was generated from the following file:
- json/json_string.hpp