Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::date_time::date_generator_parser< date_type, charT > Class Template Reference

Class for date_generator parsing. More...

#include <date_generator_parser.hpp>

Inheritance diagram for boost::date_time::date_generator_parser< date_type, charT >:

Public Types

enum  phrase_elements {
  first =0,
  second,
  third,
  fourth,
  fifth,
  last,
  before,
  after,
  of,
  number_of_phrase_elements
}
 
typedef std::basic_string< charT > string_type
 
typedef
std::istreambuf_iterator
< charT > 
stream_itr_type
 
typedef date_type::month_type month_type
 
typedef date_type::day_of_week_type day_of_week_type
 
typedef date_type::day_type day_type
 
typedef string_parse_tree< charT > parse_tree_type
 
typedef
parse_tree_type::parse_match_result_type 
match_results
 
typedef std::vector
< std::basic_string< charT > > 
collection_type
 
typedef partial_date< date_type > partial_date_type
 
typedef nth_kday_of_month
< date_type > 
nth_kday_type
 
typedef first_kday_of_month
< date_type > 
first_kday_type
 
typedef last_kday_of_month
< date_type > 
last_kday_type
 
typedef first_kday_after
< date_type > 
kday_after_type
 
typedef first_kday_before
< date_type > 
kday_before_type
 
typedef charT char_type
 

Public Member Functions

 date_generator_parser ()
 Creates a date_generator_parser with the default set of "element_strings". More...
 
 date_generator_parser (const string_type &first_str, const string_type &second_str, const string_type &third_str, const string_type &fourth_str, const string_type &fifth_str, const string_type &last_str, const string_type &before_str, const string_type &after_str, const string_type &of_str)
 Creates a date_generator_parser using a user defined set of element strings. More...
 
void element_strings (const string_type &first_str, const string_type &second_str, const string_type &third_str, const string_type &fourth_str, const string_type &fifth_str, const string_type &last_str, const string_type &before_str, const string_type &after_str, const string_type &of_str)
 Replace strings that determine nth week for generator. More...
 
void element_strings (const collection_type &col)
 
template<class facet_type >
partial_date_type get_partial_date_type (stream_itr_type &sitr, stream_itr_type &stream_end, std::ios_base &a_ios, const facet_type &facet) const
 returns partial_date parsed from stream More...
 
template<class facet_type >
nth_kday_type get_nth_kday_type (stream_itr_type &sitr, stream_itr_type &stream_end, std::ios_base &a_ios, const facet_type &facet) const
 returns nth_kday_of_week parsed from stream More...
 
template<class facet_type >
first_kday_type get_first_kday_type (stream_itr_type &sitr, stream_itr_type &stream_end, std::ios_base &a_ios, const facet_type &facet) const
 returns first_kday_of_week parsed from stream More...
 
template<class facet_type >
last_kday_type get_last_kday_type (stream_itr_type &sitr, stream_itr_type &stream_end, std::ios_base &a_ios, const facet_type &facet) const
 returns last_kday_of_week parsed from stream More...
 
template<class facet_type >
kday_before_type get_kday_before_type (stream_itr_type &sitr, stream_itr_type &stream_end, std::ios_base &a_ios, const facet_type &facet) const
 returns first_kday_of_week parsed from stream More...
 
template<class facet_type >
kday_after_type get_kday_after_type (stream_itr_type &sitr, stream_itr_type &stream_end, std::ios_base &a_ios, const facet_type &facet) const
 returns first_kday_of_week parsed from stream More...
 

Static Public Attributes

static const char_type first_string [6]
 
static const char_type second_string [7]
 
static const char_type third_string [6]
 
static const char_type fourth_string [7]
 
static const char_type fifth_string [6]
 
static const char_type last_string [5]
 
static const char_type before_string [8]
 
static const char_type after_string [6]
 
static const char_type of_string [3]
 

Detailed Description

template<class date_type, typename charT>
class boost::date_time::date_generator_parser< date_type, charT >

Class for date_generator parsing.

The elements of a date_generator "phrase" are parsed from the input stream in a particular order. All elements are required and the order in which they appear cannot change, however, the elements themselves can be changed. The default elements and their order are as follows:

  • partial_date => "dd Month"
  • nth_day_of_the_week_in_month => "nth weekday of month"
  • first_day_of_the_week_in_month => "first weekday of month"
  • last_day_of_the_week_in_month => "last weekday of month"
  • first_day_of_the_week_after => "weekday after"
  • first_day_of_the_week_before => "weekday before"

Weekday and Month names and formats are handled via the date_input_facet.

Member Typedef Documentation

template<class date_type, typename charT>
typedef charT boost::date_time::date_generator_parser< date_type, charT >::char_type
template<class date_type, typename charT>
typedef std::vector<std::basic_string<charT> > boost::date_time::date_generator_parser< date_type, charT >::collection_type
template<class date_type, typename charT>
typedef date_type::day_of_week_type boost::date_time::date_generator_parser< date_type, charT >::day_of_week_type
template<class date_type, typename charT>
typedef date_type::day_type boost::date_time::date_generator_parser< date_type, charT >::day_type
template<class date_type, typename charT>
typedef first_kday_of_month<date_type> boost::date_time::date_generator_parser< date_type, charT >::first_kday_type
template<class date_type, typename charT>
typedef first_kday_after<date_type> boost::date_time::date_generator_parser< date_type, charT >::kday_after_type
template<class date_type, typename charT>
typedef first_kday_before<date_type> boost::date_time::date_generator_parser< date_type, charT >::kday_before_type
template<class date_type, typename charT>
typedef last_kday_of_month<date_type> boost::date_time::date_generator_parser< date_type, charT >::last_kday_type
template<class date_type, typename charT>
typedef parse_tree_type::parse_match_result_type boost::date_time::date_generator_parser< date_type, charT >::match_results
template<class date_type, typename charT>
typedef date_type::month_type boost::date_time::date_generator_parser< date_type, charT >::month_type
template<class date_type, typename charT>
typedef nth_kday_of_month<date_type> boost::date_time::date_generator_parser< date_type, charT >::nth_kday_type
template<class date_type, typename charT>
typedef string_parse_tree<charT> boost::date_time::date_generator_parser< date_type, charT >::parse_tree_type
template<class date_type, typename charT>
typedef partial_date<date_type> boost::date_time::date_generator_parser< date_type, charT >::partial_date_type
template<class date_type, typename charT>
typedef std::istreambuf_iterator<charT> boost::date_time::date_generator_parser< date_type, charT >::stream_itr_type
template<class date_type, typename charT>
typedef std::basic_string<charT> boost::date_time::date_generator_parser< date_type, charT >::string_type

Member Enumeration Documentation

template<class date_type, typename charT>
enum boost::date_time::date_generator_parser::phrase_elements
Enumerator
first 
second 
third 
fourth 
fifth 
last 
before 
after 
of 
number_of_phrase_elements 

Constructor & Destructor Documentation

template<class date_type, typename charT>
boost::date_time::date_generator_parser< date_type, charT >::date_generator_parser ( )
inline

Creates a date_generator_parser with the default set of "element_strings".

template<class date_type, typename charT>
boost::date_time::date_generator_parser< date_type, charT >::date_generator_parser ( const string_type first_str,
const string_type second_str,
const string_type third_str,
const string_type fourth_str,
const string_type fifth_str,
const string_type last_str,
const string_type before_str,
const string_type after_str,
const string_type of_str 
)
inline

Creates a date_generator_parser using a user defined set of element strings.

Member Function Documentation

template<class date_type, typename charT>
void boost::date_time::date_generator_parser< date_type, charT >::element_strings ( const string_type first_str,
const string_type second_str,
const string_type third_str,
const string_type fourth_str,
const string_type fifth_str,
const string_type last_str,
const string_type before_str,
const string_type after_str,
const string_type of_str 
)
inline
template<class date_type, typename charT>
void boost::date_time::date_generator_parser< date_type, charT >::element_strings ( const collection_type col)
inline
template<class date_type, typename charT>
template<class facet_type >
first_kday_type boost::date_time::date_generator_parser< date_type, charT >::get_first_kday_type ( stream_itr_type sitr,
stream_itr_type stream_end,
std::ios_base &  a_ios,
const facet_type &  facet 
) const
inline

returns first_kday_of_week parsed from stream

Referenced by boost::date_time::date_input_facet< time_type::date_type, CharT, InItrT >::get().

template<class date_type, typename charT>
template<class facet_type >
kday_after_type boost::date_time::date_generator_parser< date_type, charT >::get_kday_after_type ( stream_itr_type sitr,
stream_itr_type stream_end,
std::ios_base &  a_ios,
const facet_type &  facet 
) const
inline

returns first_kday_of_week parsed from stream

Referenced by boost::date_time::date_input_facet< time_type::date_type, CharT, InItrT >::get().

template<class date_type, typename charT>
template<class facet_type >
kday_before_type boost::date_time::date_generator_parser< date_type, charT >::get_kday_before_type ( stream_itr_type sitr,
stream_itr_type stream_end,
std::ios_base &  a_ios,
const facet_type &  facet 
) const
inline

returns first_kday_of_week parsed from stream

Referenced by boost::date_time::date_input_facet< time_type::date_type, CharT, InItrT >::get().

template<class date_type, typename charT>
template<class facet_type >
last_kday_type boost::date_time::date_generator_parser< date_type, charT >::get_last_kday_type ( stream_itr_type sitr,
stream_itr_type stream_end,
std::ios_base &  a_ios,
const facet_type &  facet 
) const
inline

returns last_kday_of_week parsed from stream

Referenced by boost::date_time::date_input_facet< time_type::date_type, CharT, InItrT >::get().

template<class date_type, typename charT>
template<class facet_type >
nth_kday_type boost::date_time::date_generator_parser< date_type, charT >::get_nth_kday_type ( stream_itr_type sitr,
stream_itr_type stream_end,
std::ios_base &  a_ios,
const facet_type &  facet 
) const
inline

returns nth_kday_of_week parsed from stream

Referenced by boost::date_time::date_input_facet< time_type::date_type, CharT, InItrT >::get().

template<class date_type, typename charT>
template<class facet_type >
partial_date_type boost::date_time::date_generator_parser< date_type, charT >::get_partial_date_type ( stream_itr_type sitr,
stream_itr_type stream_end,
std::ios_base &  a_ios,
const facet_type &  facet 
) const
inline

Member Data Documentation

template<class date_type, typename charT>
const date_generator_parser< date_type, CharT >::char_type boost::date_time::date_generator_parser< date_type, CharT >::after_string
static
Initial value:
=
{'a','f','t','e','r'}
template<class date_type, typename charT>
const date_generator_parser< date_type, CharT >::char_type boost::date_time::date_generator_parser< date_type, CharT >::before_string
static
Initial value:
=
{'b','e','f','o','r','e'}
template<class date_type, typename charT>
const date_generator_parser< date_type, CharT >::char_type boost::date_time::date_generator_parser< date_type, CharT >::fifth_string
static
Initial value:
=
{'f','i','f','t','h'}
template<class date_type, typename charT>
const date_generator_parser< date_type, CharT >::char_type boost::date_time::date_generator_parser< date_type, CharT >::first_string
static
Initial value:
=
{'f','i','r','s','t'}
template<class date_type, typename charT>
const date_generator_parser< date_type, CharT >::char_type boost::date_time::date_generator_parser< date_type, CharT >::fourth_string
static
Initial value:
=
{'f','o','u','r','t','h'}
template<class date_type, typename charT>
const date_generator_parser< date_type, CharT >::char_type boost::date_time::date_generator_parser< date_type, CharT >::last_string
static
Initial value:
=
{'l','a','s','t'}
template<class date_type, typename charT>
const date_generator_parser< date_type, CharT >::char_type boost::date_time::date_generator_parser< date_type, CharT >::of_string
static
Initial value:
=
{'o','f'}
template<class date_type, typename charT>
const date_generator_parser< date_type, CharT >::char_type boost::date_time::date_generator_parser< date_type, CharT >::second_string
static
Initial value:
=
{'s','e','c','o','n','d'}
template<class date_type, typename charT>
const date_generator_parser< date_type, CharT >::char_type boost::date_time::date_generator_parser< date_type, CharT >::third_string
static
Initial value:
=
{'t','h','i','r','d'}

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