JSON mapper with mapping options.
More...
#include <json.hpp>
|
| JSONMapper ()=delete |
|
| JSONMapper (const anch::json::MappingOptions &options) |
|
virtual | ~JSONMapper () |
|
template<typename T> |
void | serialize (const T &value, std::ostream &out) |
|
template<typename T> |
void | serialize (const std::vector< T > &value, std::ostream &out) |
|
template<typename T> |
void | serialize (const std::list< T > &value, std::ostream &out) |
|
template<typename T> |
void | serialize (const std::set< T > &value, std::ostream &out) |
|
template<typename T> |
void | serialize (const std::map< std::string, T > &value, std::ostream &out) |
|
template<typename T> |
std::string | serialize (const T &value) |
|
template<typename T> |
std::string | serialize (const std::vector< T > &value) |
|
template<typename T> |
std::string | serialize (const std::list< T > &value) |
|
template<typename T> |
std::string | serialize (const std::set< T > &value) |
|
template<typename T> |
std::string | serialize (const std::map< std::string, T > &value) |
|
template<typename T> |
void | deserialize (T &value, std::istream &input) |
|
template<typename T> |
T | deserialize (std::istream &input) |
|
template<typename T> |
void | deserialize (std::vector< T > &values, std::istream &input) |
|
template<typename T> |
void | deserialize (std::list< T > &values, std::istream &input) |
|
template<typename T> |
void | deserialize (std::set< T > &values, std::istream &input) |
|
template<typename T> |
void | deserialize (std::map< std::string, T > &values, std::istream &input) |
|
JSON mapper with mapping options.
JSON mapper declaration which will always use same mapping options
- Author
- Vincent Lachenal
- Since
- 0.1
◆ JSONMapper() [1/2]
anch::json::JSONMapper::JSONMapper |
( |
| ) |
|
|
delete |
◆ JSONMapper() [2/2]
JSONMapper constructor
- Parameters
-
options | the mapping options |
◆ ~JSONMapper()
virtual anch::json::JSONMapper::~JSONMapper |
( |
| ) |
|
|
virtual |
◆ deserialize() [1/6]
template<typename T>
T anch::json::JSONMapper::deserialize |
( |
std::istream & | input | ) |
|
Deserialize object
- Template Parameters
-
- Parameters
-
input | the input stream to parse |
- Returns
- the deserialized object by copy
◆ deserialize() [2/6]
template<typename T>
void anch::json::JSONMapper::deserialize |
( |
std::list< T > & | values, |
|
|
std::istream & | input ) |
Deserialize objects
- Template Parameters
-
- Parameters
-
values | the values to fill |
input | the input stream to parse |
- Returns
true
◆ deserialize() [3/6]
template<typename T>
void anch::json::JSONMapper::deserialize |
( |
std::map< std::string, T > & | values, |
|
|
std::istream & | input ) |
Deserialize objects
- Template Parameters
-
- Parameters
-
values | the values to fill |
input | the input stream to parse |
◆ deserialize() [4/6]
template<typename T>
void anch::json::JSONMapper::deserialize |
( |
std::set< T > & | values, |
|
|
std::istream & | input ) |
Deserialize objects
- Template Parameters
-
- Parameters
-
values | the values to fill |
input | the input stream to parse |
- Returns
true
◆ deserialize() [5/6]
template<typename T>
void anch::json::JSONMapper::deserialize |
( |
std::vector< T > & | values, |
|
|
std::istream & | input ) |
Deserialize objects
- Template Parameters
-
- Parameters
-
values | the values to fill |
input | the input stream to parse |
- Returns
true
◆ deserialize() [6/6]
template<typename T>
void anch::json::JSONMapper::deserialize |
( |
T & | value, |
|
|
std::istream & | input ) |
Deserialize object
- Template Parameters
-
- Parameters
-
value | the value to fill |
input | the input stream to parse |
- Returns
true
when value has been found, false
otherwise
◆ serialize() [1/10]
template<typename T>
std::string anch::json::JSONMapper::serialize |
( |
const std::list< T > & | value | ) |
|
Serialize objects
- Template Parameters
-
- Parameters
-
value | the object to serialize |
- Returns
- the serialized objects as
std::string
◆ serialize() [2/10]
template<typename T>
void anch::json::JSONMapper::serialize |
( |
const std::list< T > & | value, |
|
|
std::ostream & | out ) |
Serialize objects
- Template Parameters
-
- Parameters
-
value | the objects to serialize |
out | the output stream to write in |
◆ serialize() [3/10]
template<typename T>
std::string anch::json::JSONMapper::serialize |
( |
const std::map< std::string, T > & | value | ) |
|
Serialize objects
- Template Parameters
-
- Parameters
-
value | the object to serialize |
- Returns
- the serialized objects as
std::string
◆ serialize() [4/10]
template<typename T>
void anch::json::JSONMapper::serialize |
( |
const std::map< std::string, T > & | value, |
|
|
std::ostream & | out ) |
Serialize objects
- Template Parameters
-
- Parameters
-
value | the objects to serialize |
out | the output stream to write in |
◆ serialize() [5/10]
template<typename T>
std::string anch::json::JSONMapper::serialize |
( |
const std::set< T > & | value | ) |
|
Serialize objects
- Template Parameters
-
- Parameters
-
value | the object to serialize |
- Returns
- the serialized objects as
std::string
◆ serialize() [6/10]
template<typename T>
void anch::json::JSONMapper::serialize |
( |
const std::set< T > & | value, |
|
|
std::ostream & | out ) |
Serialize objects
- Template Parameters
-
- Parameters
-
value | the objects to serialize |
out | the output stream to write in |
◆ serialize() [7/10]
template<typename T>
std::string anch::json::JSONMapper::serialize |
( |
const std::vector< T > & | value | ) |
|
Serialize objects
- Template Parameters
-
- Parameters
-
value | the object to serialize |
- Returns
- the serialized objects as
std::string
◆ serialize() [8/10]
template<typename T>
void anch::json::JSONMapper::serialize |
( |
const std::vector< T > & | value, |
|
|
std::ostream & | out ) |
Serialize objects
- Template Parameters
-
- Parameters
-
value | the objects to serialize |
out | the output stream to write in |
◆ serialize() [9/10]
template<typename T>
std::string anch::json::JSONMapper::serialize |
( |
const T & | value | ) |
|
Serialize object
- Template Parameters
-
- Parameters
-
value | the object to serialize |
- Returns
- the serialized object as
std::string
◆ serialize() [10/10]
template<typename T>
void anch::json::JSONMapper::serialize |
( |
const T & | value, |
|
|
std::ostream & | out ) |
Serialize object
- Template Parameters
-
- Parameters
-
value | the object to serialize |
out | the output stream to write in |
The documentation for this class was generated from the following file: