
AMDG On 05/02/2011 03:31 PM, Marshall Clow wrote:
Here's a proposed patch for ticket #2475. https://svn.boost.org/trac/boost/ticket/2475 Anyone love it? Hate it?
Index: ../../../boost/date_time/tz_db_base.hpp =================================================================== --- ../../../boost/date_time/tz_db_base.hpp (revision 71667) +++ ../../../boost/date_time/tz_db_base.hpp (working copy) @@ -166,22 +166,26 @@ //! Constructs an empty database tz_db_base() {}
+ //! Process csv data stream, may throw exceptions + /*! May throw bad_field_count exceptions */ + void load_from_stream(std::ifstream &ifs)
Should't this be std::istream?
+ { + std::string buff; + while( std::getline(ifs, buff)) + parse_string(buff); + } + //! Process csv data file, may throw exceptions /*! May throw data_not_accessible, or bad_field_count exceptions */ void load_from_file(const std::string& pathspec) { - string_type in_str; - std::string buff; - std::ifstream ifs(pathspec.c_str()); - if(!ifs){ + if(!ifs) boost::throw_exception(data_not_accessible(pathspec)); - } + + std::string buff; std::getline(ifs, buff); // first line is column headings - - while( std::getline(ifs, buff)) { - parse_string(buff); - } + load_from_stream(ifs); }
//! returns true if record successfully added to map
Any particular reason you changed the brace style? In Christ, Steven Watanabe