Boost logo

Boost Users :

Subject: [Boost-users] Calling date_time time_input_facet directly
From: Jeffery Cavallaro (jcavalla_at_[hidden])
Date: 2009-03-04 17:03:37


I have to parse a leading timestamp in a bunch of records, and I would like
to avoid having to copy each record into a stringstream just to parser the
timestamp. Does anyone know how to call the date_time time_input_facet
directly? I did something like the following:

char buffer[N];

typedef boost::date_time::time_input_facet<boost::posix_time::ptime, char,
char *> TimeFacet;

TimeFacet *f = new TimeFacet;
boost::posix_time::ptime t;
f->get(buffer, buffer + size, ???, t);

But I don't know what to pass for the 3rd arg, which is an ios_base &. I
tried an ios instance and a stringstream instance, but I couldn't get
anything to work - the compiler can't seem to match the call.

-- 
Jeffery Cavallaro, MTV-45-208G
Infrastructure Engineering
Google Inc.
1600 Amphitheatre Parkway
Mountain View, CA  94043
650-214-2552


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net