libpniio
Public Types | Public Member Functions | Data Fields
pni::io::sequence_rule< ITERT, ST > Struct Template Reference

container parser More...

#include <sequence_rule.hpp>

Inheritance diagram for pni::io::sequence_rule< ITERT, ST >:
Inheritance graph
[legend]
Collaboration diagram for pni::io::sequence_rule< ITERT, ST >:
Collaboration graph
[legend]

Public Types

typedef ST::value_type value_type
 value type of the sequence type More...
 

Public Member Functions

 sequence_rule ()
 default constructor More...
 
 sequence_rule (char del)
 constructor More...
 
 sequence_rule (char start, char stop)
 constructor More...
 
 sequence_rule (char start, char stop, char del)
 constructor More...
 

Data Fields

get_rule_type< ITERT,
value_type >::type 
element_rule_
 rule to parse the value_type of the sequence More...
 
delimiter_rule< ITERT > delimiter_
 delimiter rule More...
 
boost::spirit::qi::rule< ITERT > start_
 rule for the start symbol of the sequence More...
 
boost::spirit::qi::rule< ITERT > stop_
 rule for the stop symbol of the sequence More...
 
char start_symbol_
 a possible start symbol More...
 
char stop_symbol_
 a possible stop symbol More...
 
boost::spirit::qi::rule< ITERT,
ST()> 
sequence_
 the full rule to parse the sequence More...
 

Detailed Description

template<typename ITERT, typename ST>
struct pni::io::sequence_rule< ITERT, ST >

This parser reads a linear container of data from a string. The data type of the container is assumed to be homogeneous. This means that all elements must match with the parser selected for the element type.

In their string representation container data is assumed to be embraced between a start and a stop token. The elements are assumed to be separated by a delimiter token.

The container can be any STL compliant container type.

Template Parameters
ITERTinput iterator type
CTYPEcontainer type

Member Typedef Documentation

template<typename ITERT , typename ST >
typedef ST::value_type pni::io::sequence_rule< ITERT, ST >::value_type

Constructor & Destructor Documentation

template<typename ITERT , typename ST >
pni::io::sequence_rule< ITERT, ST >::sequence_rule ( )
inline

When using the default constructor the elements are assumed to be separated by an arbitrary number of blanks. No start and stop symbol are taken into account.

template<typename ITERT , typename ST >
pni::io::sequence_rule< ITERT, ST >::sequence_rule ( char  del)
inline

This version of the sequence_rule constructor allows passing a a custom delimiter symbol. The delimiter_rule class is used to parse the delimiter. Thus, the delimiter symbol can have an arbitrary number of preceding and tailing blanks.

Parameters
delthe delimiter symbol used in the rule
template<typename ITERT , typename ST >
pni::io::sequence_rule< ITERT, ST >::sequence_rule ( char  start,
char  stop 
)
inline

Set a start and stop symbol. In this case the rule expects that the sequence is embraced into a start and stop symbol. However, the individual elements are still separated by an arbitrary number of blanks.

Parameters
startthe start symbol used for the sequence
stopthe stop symbol used for the sequence
template<typename ITERT , typename ST >
pni::io::sequence_rule< ITERT, ST >::sequence_rule ( char  start,
char  stop,
char  del 
)
inline

Customizes the start and stop symbol as well as the delimiter symbol.

Parameters
startthe start symbol for the sequence
stopthe stop symbol for the sequence
delthe delimiter symbol for the sequence

Field Documentation

template<typename ITERT , typename ST >
delimiter_rule<ITERT> pni::io::sequence_rule< ITERT, ST >::delimiter_
template<typename ITERT , typename ST >
get_rule_type<ITERT,value_type>::type pni::io::sequence_rule< ITERT, ST >::element_rule_
template<typename ITERT , typename ST >
boost::spirit::qi::rule<ITERT,ST()> pni::io::sequence_rule< ITERT, ST >::sequence_
template<typename ITERT , typename ST >
boost::spirit::qi::rule<ITERT> pni::io::sequence_rule< ITERT, ST >::start_
template<typename ITERT , typename ST >
char pni::io::sequence_rule< ITERT, ST >::start_symbol_
template<typename ITERT , typename ST >
boost::spirit::qi::rule<ITERT> pni::io::sequence_rule< ITERT, ST >::stop_
template<typename ITERT , typename ST >
char pni::io::sequence_rule< ITERT, ST >::stop_symbol_

The documentation for this struct was generated from the following file: