libpniio
|
slice parser More...
#include <slice_rule.hpp>
Public Member Functions | |
slice_rule () | |
default constructor More... | |
Data Fields | |
boost::spirit::qi::rule< ITERT, boost::spirit::qi::locals < size_t, size_t, size_t > , pni::core::slice() > | slice_ |
rule to parse a slice string More... | |
This parser reads slice objects from a string. A slice is represented by three numbers: the start index, the last index, and a stride. In string representation these three values are written as
where a : is used as separator between the numbers. There are several flavors of strings that can be used to denote a slice
start
- here stop is assumed to be start+1 and stride=1. start:stop
- where stride is assumed to be 1
:stop - where start=0 and stride = 1
:stop:stride - where start is assumed to be 0This parser is capable of managing all these variations. It can be used like this
ITERT | iterator type for the parser |
|
inline |
boost::spirit::qi::rule<ITERT, boost::spirit::qi::locals<size_t,size_t,size_t>, pni::core::slice() > pni::io::slice_rule< ITERT >::slice_ |