libpniio
Data Structures | Public Member Functions | Data Fields
pni::io::value_rule< ITERT > Struct Template Reference

value rule More...

#include <value_rule.hpp>

Inheritance diagram for pni::io::value_rule< ITERT >:
Inheritance graph
[legend]
Collaboration diagram for pni::io::value_rule< ITERT >:
Collaboration graph
[legend]

Data Structures

struct  value_constructor
 value construction lazy function More...
 
class  value_constructor_visitor
 visitor for value construction More...
 

Public Member Functions

 value_rule ()
 default constructor More...
 

Data Fields

boost::mpl::at< spirit_rules,
pni::core::int64 >::type 
integer_rule_
 rule for parsing an integer More...
 
boost::mpl::at< spirit_rules,
pni::core::float64 >::type 
float_rule_
 rule for parsing a floating point number More...
 
complex_rule< ITERT,
pni::core::complex64 > 
complex_rule_
 rule for parsing a complex number More...
 
boost::spirit::qi::rule< ITERT,
pni::core::value()> 
value_
 value reading rule More...
 
boost::spirit::qi::rule< ITERT > sign_rule
 rule to match the + or - sign More...
 
boost::spirit::qi::rule< ITERT > float_signs
 rule to match . or e used to denote a floating point number More...
 
boost::phoenix::function
< value_constructor
construct_value
 lazy function to assemble a value instance More...
 

Detailed Description

template<typename ITERT>
struct pni::io::value_rule< ITERT >

This rule parses an input string and automatically selects the proper parser for the input value. From its ASCII representation the particular type a value belongs to is not entirely visible. For instance it is not possible to distinguish the different integer types from a single ASCII representation. Neither is this possible for floating point types and complex types. Thus, the number of different parsers used in this rule are limitted. As a fallback the string parser is the last resort tho get the data parsed. The following parsers will be used internally

A typical application would be to parse the value part of key-value pairs in an ASCII file where the data type of the attribute is not known in advance. The rule will make a best guess to automatically find the appropriate type or uses a string representation in the worst case.

The input string is assumed to be stripped from all leading and trailing blank and newline symbols. The rule is only default constructible. No additional options have to be applied.

Template Parameters
ITERTiterator type

Constructor & Destructor Documentation

template<typename ITERT >
pni::io::value_rule< ITERT >::value_rule ( )
inline

Field Documentation

template<typename ITERT >
complex_rule<ITERT,pni::core::complex64> pni::io::value_rule< ITERT >::complex_rule_
template<typename ITERT >
boost::phoenix::function<value_constructor> pni::io::value_rule< ITERT >::construct_value
template<typename ITERT >
boost::mpl::at< spirit_rules, pni::core::float64 >::type pni::io::value_rule< ITERT >::float_rule_
template<typename ITERT >
boost::spirit::qi::rule<ITERT> pni::io::value_rule< ITERT >::float_signs
template<typename ITERT >
boost::mpl::at< spirit_rules, pni::core::int64 >::type pni::io::value_rule< ITERT >::integer_rule_
template<typename ITERT >
boost::spirit::qi::rule<ITERT> pni::io::value_rule< ITERT >::sign_rule
template<typename ITERT >
boost::spirit::qi::rule<ITERT,pni::core::value()> pni::io::value_rule< ITERT >::value_

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