Exemplo n.º 1
0
 void stream_format_state<Ch,Tr>:: set_by_stream(const basic_ios& os) {
     // set our params according to the state of this stream
     flags_ = os.flags();
     width_ = os.width();
     precision_ = os.precision();
     fill_ = os.fill();
     rdstate_ = os.rdstate();
     exceptions_ = os.exceptions();
 }
Exemplo n.º 2
0
    void stream_format_state<Ch,Tr>:: apply_on (basic_ios & os,
                      boost::io::detail::locale_t * loc_default) const {
        // set the state of this stream according to our params
        if(width_ != -1)
            os.width(width_);
        if(precision_ != -1)
            os.precision(precision_);
        if(fill_ != 0)
            os.fill(fill_);
        os.flags(flags_);
        os.clear(rdstate_);
        os.exceptions(exceptions_);
#if !defined(BOOST_NO_STD_LOCALE)
        if(loc_)
            os.imbue(loc_.get());
        else if(loc_default)
            os.imbue(*loc_default);
#else
        (void) loc_default; // keep compiler quiet if we don't support locales
#endif        
    }