EvolvingObjects
eoserial::String Class Reference

JSON String. More...

#include <String.h>

Inheritance diagram for eoserial::String:
eoserial::Entity

List of all members.

Public Member Functions

 String (const std::string &str)
 Default ctor.
 String ()
 Ctor used only when parsing.
virtual std::ostream & print (std::ostream &out) const
 Prints out the string.
template<class T >
void deserialize (T &value)
 Deserializes the current String into a given primitive type value.
template<>
void deserialize (std::string &value)
 Specialization for strings, which don't need to be converted through a stringstream.

Protected Member Functions

 String (const String &_)
Stringoperator= (const String &_)

Detailed Description

JSON String.

Wrapper for string, so as to be used as a JSON object.

Definition at line 40 of file String.h.


Constructor & Destructor Documentation

eoserial::String::String ( const std::string &  str) [inline]

Default ctor.

Parameters:
strThe string we want to wrap.

Definition at line 48 of file String.h.


Member Function Documentation

template<class T >
void eoserial::String::deserialize ( T &  value) [inline]

Deserializes the current String into a given primitive type value.

Casts a eoserial::String into a primitive value, or in a type which at least overload operator>>.

Parameters:
valueThe value in which we're writing.
valueA reference to the variable we're writing into.

It's not necessary to specify the variable type, which can be infered by compiler when invoking.

Definition at line 83 of file String.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends