Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::chrono::time_point_get< CharT, InputIterator > Class Template Reference

#include <time_point_get.hpp>

Inheritance diagram for boost::chrono::time_point_get< CharT, InputIterator >:
Collaboration diagram for boost::chrono::time_point_get< CharT, InputIterator >:

Public Types

typedef CharT char_type
 Type of character the facet is instantiated on. More...
 
typedef InputIterator iter_type
 Type of iterator used to scan the character buffer. More...
 

Public Member Functions

 time_point_get (size_t refs=0)
 Construct a time_point_get facet. More...
 
template<class Clock , class Duration >
iter_type get (iter_type i, iter_type e, std::ios_base &is, std::ios_base::iostate &err, time_point< Clock, Duration > &tp, const char_type *pattern, const char_type *pat_end) const
 
template<class Clock , class Duration >
iter_type get (time_point_units< CharT > const &facet, iter_type s, iter_type end, std::ios_base &ios, std::ios_base::iostate &err, time_point< Clock, Duration > &tp, const char_type *pattern, const char_type *pat_end) const
 
template<typename Rep , typename Period >
iter_type get_duration (iter_type i, iter_type e, std::ios_base &is, std::ios_base::iostate &err, duration< Rep, Period > &d) const
 
template<typename Rep , typename Period >
iter_type get_duration (duration_get< CharT > const &facet, iter_type s, iter_type end, std::ios_base &ios, std::ios_base::iostate &err, duration< Rep, Period > &d) const
 
template<class Clock >
iter_type get_epoch (iter_type i, iter_type e, std::ios_base &is, std::ios_base::iostate &err) const
 Let facet be the time_point_units facet associated to is or a new instance of the default time_point_units_default facet. More...
 
template<class Clock >
iter_type get_epoch (time_point_units< CharT > const &facet, iter_type i, iter_type e, std::ios_base &, std::ios_base::iostate &err) const
 
 ~time_point_get ()
 Destroy the facet More...
 

Static Public Attributes

static std::locale::id id
 Unique identifier for this type of facet. More...
 

Member Typedef Documentation

template<class CharT , class InputIterator = std::istreambuf_iterator<CharT>>
typedef CharT boost::chrono::time_point_get< CharT, InputIterator >::char_type

Type of character the facet is instantiated on.

template<class CharT , class InputIterator = std::istreambuf_iterator<CharT>>
typedef InputIterator boost::chrono::time_point_get< CharT, InputIterator >::iter_type

Type of iterator used to scan the character buffer.

Constructor & Destructor Documentation

template<class CharT , class InputIterator = std::istreambuf_iterator<CharT>>
boost::chrono::time_point_get< CharT, InputIterator >::time_point_get ( size_t  refs = 0)
inlineexplicit

Construct a time_point_get facet.

Parameters
refsConstruct a time_point_get facet. If the refs argument is 0 then destruction of the object is delegated to the locale, or locales, containing it. This allows the user to ignore lifetime management issues. On the other had, if refs is 1 then the object must be explicitly deleted; the locale will not do so. In this case, the object can be maintained across the lifetime of multiple locales.
template<class CharT , class InputIterator = std::istreambuf_iterator<CharT>>
boost::chrono::time_point_get< CharT, InputIterator >::~time_point_get ( )
inline

Destroy the facet

Member Function Documentation

template<class CharT , class InputIterator = std::istreambuf_iterator<CharT>>
template<class Clock , class Duration >
iter_type boost::chrono::time_point_get< CharT, InputIterator >::get ( iter_type  i,
iter_type  e,
std::ios_base &  is,
std::ios_base::iostate &  err,
time_point< Clock, Duration > &  tp,
const char_type pattern,
const char_type pat_end 
) const
inline
Parameters
sstart input stream iterator
endend input stream iterator
iosa reference to a ios_base
errthe ios_base state
dthe duration
patternbegin of the formatting pattern
pat_endend of the formatting pattern

Requires: [pattern,pat_end) shall be a valid range.

Effects: The function starts by evaluating err = std::ios_base::goodbit. It then enters a loop, reading zero or more characters from s at each iteration. Unless otherwise specified below, the loop terminates when the first of the following conditions holds:

  • The expression pattern == pat_end evaluates to true.
  • The expression err == std::ios_base::goodbit evaluates to false.
  • The expression s == end evaluates to true, in which case the function evaluates err = std::ios_base::eofbit | std::ios_base::failbit.
  • The next element of pattern is equal to '', followed by a conversion specifier character, the functions get_duration or get_epoch are called depending on whether the format is 'd' or 'e'. If the number of elements in the range [pattern,pat_end) is not sufficient to unambiguously determine whether the conversion specification is complete and valid, the function evaluates err = std::ios_base::failbit. Otherwise, the function evaluates s = do_get(s, end, ios, err, d). If err == std::ios_base::goodbit holds after the evaluation of the expression, the function increments pattern to point just past the end of the conversion specification and continues looping.
  • The expression isspace(*pattern, ios.getloc()) evaluates to true, in which case the function first increments pattern until pattern == pat_end || !isspace(*pattern, ios.getloc()) evaluates to true, then advances s until s == end || !isspace(*s, ios.getloc()) is true, and finally resumes looping.
  • The next character read from s matches the element pointed to by pattern in a case-insensitive comparison, in which case the function evaluates ++pattern, ++s and continues looping. Otherwise, the function evaluates err = std::ios_base::failbit.

Returns: s

References boost::multiprecision::backends::i.

template<class CharT , class InputIterator = std::istreambuf_iterator<CharT>>
template<class Clock , class Duration >
iter_type boost::chrono::time_point_get< CharT, InputIterator >::get ( time_point_units< CharT > const &  facet,
iter_type  s,
iter_type  end,
std::ios_base &  ios,
std::ios_base::iostate &  err,
time_point< Clock, Duration > &  tp,
const char_type pattern,
const char_type pat_end 
) const
inline
template<class CharT , class InputIterator = std::istreambuf_iterator<CharT>>
template<typename Rep , typename Period >
iter_type boost::chrono::time_point_get< CharT, InputIterator >::get_duration ( iter_type  i,
iter_type  e,
std::ios_base &  is,
std::ios_base::iostate &  err,
duration< Rep, Period > &  d 
) const
inline
Parameters
san input stream iterator
iosa reference to a ios_base
dthe duration Stores the duration pattern from the duration_unit facet in let say str. Last as if
return get(s, end, ios, err, ios, d, str.data(), str.data() + str.size());
@codeend
@Returns An iterator pointing just beyond the last character that can be determined to be part of a valid name
/
template <class Clock, class Duration>
iter_type get(iter_type i, iter_type e, std::ios_base& is, std::ios_base::iostate& err,
time_point<Clock, Duration> &tp) const
{
if (std::has_facet<time_point_units<CharT> >(is.getloc()))
{
time_point_units<CharT> const &facet = std::use_facet<time_point_units<CharT> >(is.getloc());
std::basic_string<CharT> str = facet.get_pattern();
return get(facet, i, e, is, err, tp, str.data(), str.data() + str.size());
}
else
{
time_point_units_default<CharT> facet;
std::basic_string<CharT> str = facet.get_pattern();
return get(facet, i, e, is, err, tp, str.data(), str.data() + str.size());
}
}
where facet is either the duration_get facet associated to the ios or an instance of the default duration_get facet.

An iterator pointing just beyond the last character that can be determined to be part of a valid duration.

Referenced by boost::chrono::time_point_get< CharT, InputIterator >::get().

template<class CharT , class InputIterator = std::istreambuf_iterator<CharT>>
template<typename Rep , typename Period >
iter_type boost::chrono::time_point_get< CharT, InputIterator >::get_duration ( duration_get< CharT > const &  facet,
iter_type  s,
iter_type  end,
std::ios_base &  ios,
std::ios_base::iostate &  err,
duration< Rep, Period > &  d 
) const
inline
template<class CharT , class InputIterator = std::istreambuf_iterator<CharT>>
template<class Clock >
iter_type boost::chrono::time_point_get< CharT, InputIterator >::get_epoch ( iter_type  i,
iter_type  e,
std::ios_base &  is,
std::ios_base::iostate &  err 
) const
inline

Let facet be the time_point_units facet associated to is or a new instance of the default time_point_units_default facet.

Let epoch be the epoch string associated to the Clock using this facet. Scans i to match epoch or e is reached.

If not match before the e is reached std::ios_base::failbit is set in err. If e is reached std::ios_base::failbit is set in err.

An iterator pointing just beyond the last character that can be determined to be part of a valid epoch.

template<class CharT , class InputIterator = std::istreambuf_iterator<CharT>>
template<class Clock >
iter_type boost::chrono::time_point_get< CharT, InputIterator >::get_epoch ( time_point_units< CharT > const &  facet,
iter_type  i,
iter_type  e,
std::ios_base &  ,
std::ios_base::iostate &  err 
) const
inline

Member Data Documentation

template<class CharT , class InputIterator = std::istreambuf_iterator<CharT>>
std::locale::id boost::chrono::time_point_get< CharT, InputIterator >::id
static

Unique identifier for this type of facet.


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