Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is an old version of boost. Click here for the latest version's documentation home page.
PrevUpHomeNext

Function template fixed_string_to_int

boost::date_time::fixed_string_to_int — Helper function for parsing fixed length strings into integers.

Synopsis

// In header: <boost/date_time/format_date_parser.hpp>


template<typename int_type, typename charT> 
  int_type fixed_string_to_int(std::istreambuf_iterator< charT > & itr, 
                               std::istreambuf_iterator< charT > & stream_end, 
                               parse_match_result< charT > & mr, 
                               unsigned int length);

Description

Will consume 'length' number of characters from stream. Consumed character are transfered to parse_match_result struct. Returns '-1' if no number can be parsed or incorrect number of digits in stream.


PrevUpHomeNext