libpniio
Public Member Functions | Private Attributes
pni::io::container_io_config Class Reference

container IO configuration More...

#include <container_io_config.hpp>

Public Member Functions

 container_io_config ()
 default constructor More...
 
 container_io_config (char seperator)
 constructor More...
 
 container_io_config (char start, char stop)
 constructor More...
 
 container_io_config (char start, char stop, char seperator)
 constructor More...
 
char separator () const
 get separator symbol More...
 
char start_symbol () const
 get start symbol More...
 
char stop_symbol () const
 get stop symbol More...
 

Private Attributes

char _start
 start symbol More...
 
char _stop
 stop symbol More...
 
char _sep
 seperator symbol More...
 

Detailed Description

This type stores the parameters required to read and write container data.

Instances of this type are used for instance by the formatter<T> template when used with container types. Instances of this class are only configuratble during construction. After its construction only read only access to its members is possible.

The usage is rather simple. Configuration is done vai the constructor:

//use a semicolon as a seperator for the container elements
container_io_config config_1(';');
//use { and } to embrace the container elements
container_io_config config_2('{','}');
//use { and } to embrace the container elements and a colon as a
//seperator
container_io_config config_3('{','}',':');

Once an instance of container_io_config is created its elements can be accessed

config_1.separator();
config_1.start_symbol();
config_1.stop_symbol();

Constructor & Destructor Documentation

pni::io::container_io_config::container_io_config ( )

By default the start, and stop symbol are empty and the seperator symbol is a single blank.

pni::io::container_io_config::container_io_config ( char  seperator)

This destructor allows the determine the seperator symbol. The start and stop symbol remain empty.

Parameters
seperatorthe symbol which should be used to seperate the container elements
pni::io::container_io_config::container_io_config ( char  start,
char  stop 
)

A constructor where the user can set the start and stop symbol. The seperator symbol remains a single blank.

Parameters
startsymbol initiating the sequence
stopsymbol terminating the sequence
pni::io::container_io_config::container_io_config ( char  start,
char  stop,
char  seperator 
)

Constructor where all aspects of container IO can be determined by the user.

Parameters
startsymbol initiating the sequence
stopsymbol terminating the sequence
seperatorthe element seperator symbol

Member Function Documentation

char pni::io::container_io_config::separator ( ) const
Returns
the separator symbol of the current configuration instance
char pni::io::container_io_config::start_symbol ( ) const
Returns
the start symbol of the current configuration instance
char pni::io::container_io_config::stop_symbol ( ) const
Returns
the stop symbol of the current configuration instance

Field Documentation

char pni::io::container_io_config::_sep
private
char pni::io::container_io_config::_start
private
char pni::io::container_io_config::_stop
private

The documentation for this class was generated from the following files: