Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members

s11n::io::key_value_serializer< NodeType > Class Template Reference

A helper for serializing properties to a stream. More...

#include <data_node_functor.h>

List of all members.

Public Types

typedef NodeType node_type
typedef node_type::value_type pair_type
typedef std::map< std::string,
std::string > 
entity_translation_map

Public Member Functions

 key_value_serializer (const entity_translation_map *map, std::ostream &dest, const std::string &prefix, const std::string &separator, const std::string &suffix)
 map: needed so we can do entity translation in a unified manner here.
void operator() (const pair_type &src) const
 Sends the following formatted string to os:.


Detailed Description

template<typename NodeType>
class s11n::io::key_value_serializer< NodeType >

A helper for serializing properties to a stream.

Intended for use by Serializers, not Serializables.

NodeType is the container type used for data serialization (e.g. s11n::data_node).

Definition at line 321 of file data_node_functor.h.


Constructor & Destructor Documentation

template<typename NodeType>
s11n::io::key_value_serializer< NodeType >::key_value_serializer const entity_translation_map map,
std::ostream &  dest,
const std::string &  prefix,
const std::string &  separator,
const std::string &  suffix
[inline]
 

map: needed so we can do entity translation in a unified manner here.

It must outlive this object. Pass it 0 for no translation. Translations are only applied on VALUES, not KEYS.

prefix: inserted before each property.

separator: inserted between the key and value.

suffix: appended after each entry.

Definition at line 344 of file data_node_functor.h.


Member Function Documentation

template<typename NodeType>
void s11n::io::key_value_serializer< NodeType >::operator() const pair_type &  src  )  const [inline]
 

Sends the following formatted string to os:.

{prefix}{src.first}{separator}{src.second}{suffix}

Definition at line 360 of file data_node_functor.h.

References s11n::to_string(), and s11n::translate_entities().


The documentation for this class was generated from the following file:
Generated on Tue Oct 26 18:26:00 2004 for s11n by  doxygen 1.3.9.1