|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r75461 - trunk/boost/chrono/io
From: vicente.botet_at_[hidden]
Date: 2011-11-12 10:41:23
Author: viboes
Date: 2011-11-12 10:41:22 EST (Sat, 12 Nov 2011)
New Revision: 75461
URL: http://svn.boost.org/trac/boost/changeset/75461
Log:
Chrono: Added fill parameter.
Text files modified:
trunk/boost/chrono/io/duration_io.hpp | 4 ++--
trunk/boost/chrono/io/duration_put.hpp | 20 ++++++++++----------
trunk/boost/chrono/io/time_point_io.hpp | 4 ++--
trunk/boost/chrono/io/time_point_put.hpp | 22 +++++++++++-----------
4 files changed, 25 insertions(+), 25 deletions(-)
Modified: trunk/boost/chrono/io/duration_io.hpp
==============================================================================
--- trunk/boost/chrono/io/duration_io.hpp (original)
+++ trunk/boost/chrono/io/duration_io.hpp 2011-11-12 10:41:22 EST (Sat, 12 Nov 2011)
@@ -135,12 +135,12 @@
{
if (!std::has_facet<duration_put<CharT> >(os.getloc()))
{
- if (duration_put<CharT> ().put(os, os, d) .failed())
+ if (duration_put<CharT> ().put(os, os, os.fill(), d) .failed())
{
err = std::ios_base::badbit;
}
}
- else if (std::use_facet<duration_put<CharT> >(os.getloc()) .put(os, os, d) .failed())
+ else if (std::use_facet<duration_put<CharT> >(os.getloc()) .put(os, os, os.fill(), d) .failed())
{
err = std::ios_base::badbit;
}
Modified: trunk/boost/chrono/io/duration_put.hpp
==============================================================================
--- trunk/boost/chrono/io/duration_put.hpp (original)
+++ trunk/boost/chrono/io/duration_put.hpp 2011-11-12 10:41:22 EST (Sat, 12 Nov 2011)
@@ -88,24 +88,24 @@
* @Returns An iterator pointing immediately after the last character produced.
*/
template <typename Rep, typename Period>
- iter_type put(iter_type s, std::ios_base& ios, duration<Rep, Period> const& d, const CharT* pattern,
+ iter_type put(iter_type s, std::ios_base& ios, char_type fill, duration<Rep, Period> const& d, const CharT* pattern,
const CharT* pat_end) const
{
if (std::has_facet<duration_units<CharT, OutputIterator> >(ios.getloc()))
{
duration_units<CharT, OutputIterator> const&facet = std::use_facet<duration_units<CharT, OutputIterator> >(
ios.getloc());
- return put(facet, s, ios, d, pattern, pat_end);
+ return put(facet, s, ios, fill, d, pattern, pat_end);
}
else
{
duration_units_default<CharT, OutputIterator> facet;
- return put(facet, s, ios, d, pattern, pat_end);
+ return put(facet, s, ios, fill, d, pattern, pat_end);
}
}
template <typename Rep, typename Period>
- iter_type put(duration_units<CharT, OutputIterator> const& units_facet, iter_type s, std::ios_base& ios,
+ iter_type put(duration_units<CharT, OutputIterator> const& units_facet, iter_type s, std::ios_base& ios, char_type fill,
duration<Rep, Period> const& d, const CharT* pattern, const CharT* pat_end) const
{
@@ -124,7 +124,7 @@
{
case 'v':
{
- s = put_value(s, ios, d);
+ s = put_value(s, ios, fill, d);
break;
}
case 'u':
@@ -163,20 +163,20 @@
* @Returns An iterator pointing immediately after the last character produced.
*/
template <typename Rep, typename Period>
- iter_type put(iter_type s, std::ios_base& ios, duration<Rep, Period> const& d) const
+ iter_type put(iter_type s, std::ios_base& ios, char_type fill, duration<Rep, Period> const& d) const
{
if (std::has_facet<duration_units<CharT, OutputIterator> >(ios.getloc()))
{
duration_units<CharT, OutputIterator> const&facet = std::use_facet<duration_units<CharT, OutputIterator> >(
ios.getloc());
std::basic_string<CharT> str = facet.get_pattern();
- return put(facet, s, ios, d, str.data(), str.data() + str.size());
+ return put(facet, s, ios, fill, d, str.data(), str.data() + str.size());
}
else
{
duration_units_default<CharT, OutputIterator> facet;
std::basic_string<CharT> str = facet.get_pattern();
- return put(facet, s, ios, d, str.data(), str.data() + str.size());
+ return put(facet, s, ios, fill, d, str.data(), str.data() + str.size());
}
}
@@ -189,9 +189,9 @@
* @Returns An iterator pointing immediately after the last character produced.
*/
template <typename Rep, typename Period>
- iter_type put_value(iter_type s, std::ios_base& ios, duration<Rep, Period> const& d) const
+ iter_type put_value(iter_type s, std::ios_base& ios, char_type fill, duration<Rep, Period> const& d) const
{
- return std::use_facet<std::num_put<CharT, iter_type> >(ios.getloc()).put(s, ios, ' ',
+ return std::use_facet<std::num_put<CharT, iter_type> >(ios.getloc()).put(s, ios, fill,
static_cast<long int> (d.count()));
}
Modified: trunk/boost/chrono/io/time_point_io.hpp
==============================================================================
--- trunk/boost/chrono/io/time_point_io.hpp (original)
+++ trunk/boost/chrono/io/time_point_io.hpp 2011-11-12 10:41:22 EST (Sat, 12 Nov 2011)
@@ -230,14 +230,14 @@
{
if (!std::has_facet<time_point_put<CharT> >(os.getloc()))
{
- if (time_point_put<CharT> ().put(os, os, tp) .failed())
+ if (time_point_put<CharT> ().put(os, os, os.fill(), tp) .failed())
{
err = std::ios_base::badbit;
}
}
else
{
- if (std::use_facet<time_point_put<CharT> >(os.getloc()) .put(os, os, tp) .failed())
+ if (std::use_facet<time_point_put<CharT> >(os.getloc()) .put(os, os, os.fill(), tp).failed())
{
err = std::ios_base::badbit;
}
Modified: trunk/boost/chrono/io/time_point_put.hpp
==============================================================================
--- trunk/boost/chrono/io/time_point_put.hpp (original)
+++ trunk/boost/chrono/io/time_point_put.hpp 2011-11-12 10:41:22 EST (Sat, 12 Nov 2011)
@@ -90,24 +90,24 @@
*/
template <class Clock, class Duration>
- iter_type put(iter_type i, std::ios_base& ios, time_point<Clock, Duration> const& tp, const CharT* pattern,
+ iter_type put(iter_type i, std::ios_base& ios, char_type fill, time_point<Clock, Duration> const& tp, const CharT* pattern,
const CharT* pat_end) const
{
if (std::has_facet<time_point_units<CharT, OutputIterator> >(ios.getloc()))
{
time_point_units<CharT, OutputIterator> const &facet =
std::use_facet<time_point_units<CharT, OutputIterator> >(ios.getloc());
- return put(facet, i, ios, tp, pattern, pat_end);
+ return put(facet, i, ios, fill, tp, pattern, pat_end);
}
else
{
time_point_units_default<CharT, OutputIterator> facet;
- return put(facet, i, ios, tp, pattern, pat_end);
+ return put(facet, i, ios, fill, tp, pattern, pat_end);
}
}
template <class Clock, class Duration>
- iter_type put(time_point_units<CharT, OutputIterator> const& units_facet, iter_type s, std::ios_base& ios,
+ iter_type put(time_point_units<CharT, OutputIterator> const& units_facet, iter_type s, std::ios_base& ios, char_type fill,
time_point<Clock, Duration> const& tp, const CharT* pattern, const CharT* pat_end) const
{
@@ -126,7 +126,7 @@
{
case 'd':
{
- s = put_duration(s, ios, tp.time_since_epoch());
+ s = put_duration(s, ios, fill, tp.time_since_epoch());
break;
}
case 'e':
@@ -165,20 +165,20 @@
* @Returns An iterator pointing immediately after the last character produced.
*/
template <class Clock, class Duration>
- iter_type put(iter_type i, std::ios_base& ios, time_point<Clock, Duration> const& tp) const
+ iter_type put(iter_type i, std::ios_base& ios, char_type fill, time_point<Clock, Duration> const& tp) const
{
if (std::has_facet<time_point_units<CharT, OutputIterator> >(ios.getloc()))
{
time_point_units<CharT, OutputIterator> const &facet =
std::use_facet<time_point_units<CharT, OutputIterator> >(ios.getloc());
std::basic_string<CharT> str = facet.get_pattern();
- return put(facet, i, ios, tp, str.data(), str.data() + str.size());
+ return put(facet, i, ios, fill, tp, str.data(), str.data() + str.size());
}
else
{
time_point_units_default<CharT, OutputIterator> facet;
std::basic_string<CharT> str = facet.get_pattern();
- return put(facet, i, ios, tp, str.data(), str.data() + str.size());
+ return put(facet, i, ios, fill, tp, str.data(), str.data() + str.size());
}
}
@@ -223,17 +223,17 @@
* @Returns An iterator pointing immediately after the last character produced.
*/
template <typename Rep, typename Period>
- iter_type put_duration(iter_type i, std::ios_base& ios, duration<Rep, Period> const& d) const
+ iter_type put_duration(iter_type i, std::ios_base& ios, char_type fill, duration<Rep, Period> const& d) const
{
if (std::has_facet<duration_put<CharT> >(ios.getloc()))
{
duration_put<CharT> const &facet = std::use_facet<duration_put<CharT> >(ios.getloc());
- return facet.put(i, ios, d);
+ return facet.put(i, ios, fill, d);
}
else
{
duration_put<CharT> facet;
- return facet.put(i, ios, d);
+ return facet.put(i, ios, fill, d);
}
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk