Boost logo

Boost Users :

From: Axel (axel.azerty_at_[hidden])
Date: 2008-08-27 06:01:48


Hello

Following the documentation, the time_facet::put function take 3 common
parameters : "an iterator pointing to the next item in the stream, an
ios_base object, and the fill character.".But this is not clear for me,
i m totally new to facets.

I m using it like that and it works well :

stringstream log_stream ;
ptime time = second_clock::local_time() ;
time_facet facet("%Y-%m-%d %H:%M:%S") ;
facet.put(log_stream, log_stream, ' ' , time) ;
cout << log_stream.str() ;

But I don't understand WHY it works and I wonder some things :

What does mean the "iterator to the next item" from the documentation
since I consider the target as an input stream ?

Why use the same object for the "ios_base object" parameter ? This means
I could use a different stream, but what could be the utility of such an
usage of put() ?

Finally, what is the use of the "fill character" ?

Thanks in advance.


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