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

This is the documentation for an old version of boost. Click here for the latest Boost documentation.

Function template var_string_to_int

boost::date_time::var_string_to_int — Helper function for parsing varied length strings into integers.


template<typename int_type, typename charT> 
int_type var_string_to_int(std::istreambuf_iterator< charT > & itr, 
std::istreambuf_iterator< charT > & stream_end, 
unsigned int max_length);


Will consume 'max_length' characters from stream only if those characters are digits. Returns '-1' if no number can be parsed. Will not parse a number preceeded by a '+' or '-'.

Copyright 2001-2005 CrystalClear Software, Inc