|
| period_parser (period_range_option range_opt=AS_CLOSED_RANGE, const char_type *const period_separator=default_period_separator, const char_type *const period_start_delimeter=default_period_start_delimeter, const char_type *const period_open_range_end_delimeter=default_period_open_range_end_delimeter, const char_type *const period_closed_range_end_delimeter=default_period_closed_range_end_delimeter) |
| Constructor that sets up period parser options. More...
|
|
| period_parser (const period_parser< date_type, CharT > &p_parser) |
|
period_range_option | range_option () const |
|
void | range_option (period_range_option option) |
|
collection_type | delimiter_strings () const |
|
void | delimiter_strings (const string_type &separator, const string_type &start_delim, const string_type &open_end_delim, const string_type &closed_end_delim) |
|
template<class period_type , class duration_type , class facet_type > |
period_type | get_period (stream_itr_type &sitr, stream_itr_type &stream_end, std::ios_base &a_ios, const period_type &, const duration_type &dur_unit, const facet_type &facet) const |
| Generic code to parse a period – no matter the period type. More...
|
|
template<class date_type, typename CharT>
class boost::date_time::period_parser< date_type, CharT >
Not a facet, but a class used to specify and control period parsing.
Provides settings for the following:
- period_separator – default '/'
- period_open_start_delimeter – default '['
- period_open_range_end_delimeter – default ')'
- period_closed_range_end_delimeter – default ']'
- display_as_open_range, display_as_closed_range – default closed_range
For a typical date_period, the contents of the input stream would be
where the date format is controlled by the date facet
template<class date_type, typename CharT>
template<class period_type , class duration_type , class facet_type >
Generic code to parse a period – no matter the period type.
This generic code will parse any period using a facet to to get the 'elements'. For example, in the case of a date_period the elements will be instances of a date which will be parsed according the to setup in the passed facet parameter.
The steps for parsing a period are always the same:
- consume the start delimiter
- get start element
- consume the separator
- get either last or end element depending on range settings
- consume the end delimeter depending on range settings
Thus for a typical date period the contents of the input stream might look like this:
[March 01, 2004/June 08, 2004) <--
open range
Referenced by boost::date_time::date_input_facet< time_type::date_type, CharT, InItrT >::get(), and boost::date_time::time_input_facet< time_type, CharT, InItrT >::get().