예제 #1
0
 iter_type put_unit(duration_units<CharT> const& facet, iter_type s, std::ios_base& ios, char_type fill,
     duration<Rep, Period> const& d) const
 {
   if (facet.template is_named_unit<Period>()) {
     string_type str = facet.get_unit(get_duration_style(ios), d);
     s=std::copy(str.begin(), str.end(), s);
   } else {
     *s++ = CharT('[');
     std::use_facet<std::num_put<CharT, iter_type> >(ios.getloc()).put(s, ios, fill, Period::num);
     *s++ = CharT('/');
     std::use_facet<std::num_put<CharT, iter_type> >(ios.getloc()).put(s, ios, fill, Period::den);
     *s++ = CharT(']');
     string_type str = facet.get_n_d_unit(get_duration_style(ios), d);
     s=std::copy(str.begin(), str.end(), s);
   }
   return s;
 }
예제 #2
0
 /**
  * Explicit construction from an i/o stream.
  *
  * Store a reference to the i/o stream and the value of the associated @c duration_style.
  */
 explicit duration_style_io_saver(state_type &s) :
     s_save_(s)
 {
     a_save_ = get_duration_style(s_save_);
 }