|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80051 - in trunk/boost/date_time: . local_time
From: vicente.botet_at_[hidden]
Date: 2012-08-15 13:06:58
Author: viboes
Date: 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
New Revision: 80051
URL: http://svn.boost.org/trac/boost/changeset/80051
Log:
DateTime: apply patch to manage with #7234
Text files modified:
trunk/boost/date_time/date.hpp | 4 +-
trunk/boost/date_time/date_duration.hpp | 16 ++++----
trunk/boost/date_time/date_generators.hpp | 68 ++++++++++++++++++++--------------------
trunk/boost/date_time/date_iterator.hpp | 28 ++++++++--------
trunk/boost/date_time/date_names_put.hpp | 50 ++++++++++++++--------------
trunk/boost/date_time/dst_rules.hpp | 2
trunk/boost/date_time/dst_transition_generators.hpp | 2
trunk/boost/date_time/local_time/custom_time_zone.hpp | 10 ++--
trunk/boost/date_time/local_time/local_date_time.hpp | 2
trunk/boost/date_time/local_time/posix_time_zone.hpp | 2
trunk/boost/date_time/period_formatter.hpp | 8 ++--
trunk/boost/date_time/time_duration.hpp | 6 +-
trunk/boost/date_time/time_iterator.hpp | 32 +++++++++---------
trunk/boost/date_time/time_zone_base.hpp | 16 ++++----
trunk/boost/date_time/wrapping_int.hpp | 52 +++++++++++++++---------------
15 files changed, 149 insertions(+), 149 deletions(-)
Modified: trunk/boost/date_time/date.hpp
==============================================================================
--- trunk/boost/date_time/date.hpp (original)
+++ trunk/boost/date_time/date.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -191,8 +191,8 @@
dates. It is not exposed to users since that would require class
users to understand the inner workings of the date class.
*/
- explicit date(date_int_type days) : days_(days) {};
- explicit date(date_rep_type days) : days_(days.as_number()) {};
+ explicit date(date_int_type days) : days_(days) {}
+ explicit date(date_rep_type days) : days_(days.as_number()) {}
date_int_type days_;
};
Modified: trunk/boost/date_time/date_duration.hpp
==============================================================================
--- trunk/boost/date_time/date_duration.hpp (original)
+++ trunk/boost/date_time/date_duration.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -2,7 +2,7 @@
#define DATE_TIME_DATE_DURATION__
/* Copyright (c) 2002,2003 CrystalClear Software, Inc.
- * Use, modification and distribution is subject to the
+ * Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
@@ -26,14 +26,14 @@
, boost::subtractable1< date_duration< duration_rep_traits >
, boost::dividable2< date_duration< duration_rep_traits >, int
> > > > >
- {
+ {
public:
typedef typename duration_rep_traits::int_type duration_rep_type;
typedef typename duration_rep_traits::impl_type duration_rep;
-
+
//! Construct from a day count
- explicit date_duration(duration_rep day_count) : days_(day_count) {};
-
+ explicit date_duration(duration_rep day_count) : days_(day_count) {}
+
/*! construct from special_values - only works when
* instantiated with duration_traits_adapted */
date_duration(special_values sv) :
@@ -125,7 +125,7 @@
{
typedef long int_type;
typedef long impl_type;
- static int_type as_number(impl_type i) { return i; };
+ static int_type as_number(impl_type i) { return i; }
};
/*! Struct for instantiating date_duration <b>WITH</b> special values
@@ -135,9 +135,9 @@
{
typedef long int_type;
typedef boost::date_time::int_adapter<long> impl_type;
- static int_type as_number(impl_type i) { return i.as_number(); };
+ static int_type as_number(impl_type i) { return i.as_number(); }
};
-
+
} } //namspace date_time
Modified: trunk/boost/date_time/date_generators.hpp
==============================================================================
--- trunk/boost/date_time/date_generators.hpp (original)
+++ trunk/boost/date_time/date_generators.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -2,10 +2,10 @@
#define DATE_TIME_DATE_GENERATORS_HPP__
/* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc.
- * Use, modification and distribution is subject to the
+ * Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
- * Author: Jeff Garland, Bart Garst
+ * Author: Jeff Garland, Bart Garst
* $Date$
*/
@@ -34,16 +34,16 @@
public:
typedef typename date_type::calendar_type calendar_type;
typedef typename calendar_type::year_type year_type;
- year_based_generator() {};
- virtual ~year_based_generator() {};
+ year_based_generator() {}
+ virtual ~year_based_generator() {}
virtual date_type get_date(year_type y) const = 0;
//! Returns a string for use in a POSIX time_zone string
virtual std::string to_string() const =0;
};
-
+
//! Generates a date by applying the year to the given month and day.
/*!
- Example usage:
+ Example usage:
@code
partial_date pd(1, Jan);
partial_date pd2(70);
@@ -123,9 +123,9 @@
//months are equal
return (day_ < rhs.day_);
}
-
+
// added for streaming purposes
- month_type month() const
+ month_type month() const
{
return month_;
}
@@ -135,15 +135,15 @@
}
//! Returns string suitable for use in POSIX time zone string
- /*! Returns string formatted with up to 3 digits:
- * Jan-01 == "0"
+ /*! Returns string formatted with up to 3 digits:
+ * Jan-01 == "0"
* Feb-29 == "58"
* Dec-31 == "365" */
virtual std::string to_string() const
{
std::ostringstream ss;
date_type d(2004, month_, day_);
- unsigned short c = d.day_of_year();
+ unsigned short c = d.day_of_year();
c--; // numbered 0-365 while day_of_year is 1 based...
ss << c;
return ss.str();
@@ -161,7 +161,7 @@
/*! Based on the idea in Cal. Calc. for finding holidays that are
* the 'first Monday of September'. When instantiated with
* 'fifth' kday of month, the result will be the last kday of month
- * which can be the fourth or fifth depending on the structure of
+ * which can be the fourth or fifth depending on the structure of
* the month.
*
* The algorithm here basically guesses for the first
@@ -169,8 +169,8 @@
* type. That is, if the first of the month is a Tuesday
* and it needs Wenesday then we simply increment by a day
* and then we can add the length of a week until we get
- * to the 'nth kday'. There are probably more efficient
- * algorithms based on using a mod 7, but this one works
+ * to the 'nth kday'. There are probably more efficient
+ * algorithms based on using a mod 7, but this one works
* reasonably well for basic applications.
* \ingroup date_alg
*/
@@ -233,7 +233,7 @@
virtual std::string to_string() const
{
std::ostringstream ss;
- ss << 'M'
+ ss << 'M'
<< static_cast<int>(month_) << '.'
<< static_cast<int>(wn_) << '.'
<< static_cast<int>(dow_);
@@ -244,7 +244,7 @@
week_num wn_;
day_of_week_type dow_;
};
-
+
//! Useful generator functor for finding holidays and daylight savings
/*! Similar to nth_kday_of_month, but requires less paramters
* \ingroup date_alg
@@ -290,7 +290,7 @@
virtual std::string to_string() const
{
std::ostringstream ss;
- ss << 'M'
+ ss << 'M'
<< static_cast<int>(month_) << '.'
<< 1 << '.'
<< static_cast<int>(dow_);
@@ -300,9 +300,9 @@
month_type month_;
day_of_week_type dow_;
};
-
-
-
+
+
+
//! Calculate something like Last Sunday of January
/*! Useful generator functor for finding holidays and daylight savings
* Get the last day of the month and then calculate the difference
@@ -351,7 +351,7 @@
virtual std::string to_string() const
{
std::ostringstream ss;
- ss << 'M'
+ ss << 'M'
<< static_cast<int>(month_) << '.'
<< 5 << '.'
<< static_cast<int>(dow_);
@@ -361,8 +361,8 @@
month_type month_;
day_of_week_type dow_;
};
-
-
+
+
//! Calculate something like "First Sunday after Jan 1,2002
/*! Date generator that takes a date and finds kday after
*@code
@@ -400,7 +400,7 @@
private:
day_of_week_type dow_;
};
-
+
//! Calculate something like "First Sunday before Jan 1,2002
/*! Date generator that takes a date and finds kday after
*@code
@@ -438,10 +438,10 @@
private:
day_of_week_type dow_;
};
-
+
//! Calculates the number of days until the next weekday
/*! Calculates the number of days until the next weekday.
- * If the date given falls on a Sunday and the given weekday
+ * If the date given falls on a Sunday and the given weekday
* is Tuesday the result will be 2 days */
template<typename date_type, class weekday_type>
inline
@@ -458,8 +458,8 @@
//! Calculates the number of days since the previous weekday
/*! Calculates the number of days since the previous weekday
- * If the date given falls on a Sunday and the given weekday
- * is Tuesday the result will be 5 days. The answer will be a positive
+ * If the date given falls on a Sunday and the given weekday
+ * is Tuesday the result will be 5 days. The answer will be a positive
* number because Tuesday is 5 days before Sunday, not -5 days before. */
template<typename date_type, class weekday_type>
inline
@@ -477,9 +477,9 @@
}
//! Generates a date object representing the date of the following weekday from the given date
- /*! Generates a date object representing the date of the following
- * weekday from the given date. If the date given is 2004-May-9
- * (a Sunday) and the given weekday is Tuesday then the resulting date
+ /*! Generates a date object representing the date of the following
+ * weekday from the given date. If the date given is 2004-May-9
+ * (a Sunday) and the given weekday is Tuesday then the resulting date
* will be 2004-May-11. */
template<class date_type, class weekday_type>
inline
@@ -489,9 +489,9 @@
}
//! Generates a date object representing the date of the previous weekday from the given date
- /*! Generates a date object representing the date of the previous
- * weekday from the given date. If the date given is 2004-May-9
- * (a Sunday) and the given weekday is Tuesday then the resulting date
+ /*! Generates a date object representing the date of the previous
+ * weekday from the given date. If the date given is 2004-May-9
+ * (a Sunday) and the given weekday is Tuesday then the resulting date
* will be 2004-May-4. */
template<class date_type, class weekday_type>
inline
Modified: trunk/boost/date_time/date_iterator.hpp
==============================================================================
--- trunk/boost/date_time/date_iterator.hpp (original)
+++ trunk/boost/date_time/date_iterator.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -2,7 +2,7 @@
#define DATE_ITERATOR_HPP___
/* Copyright (c) 2002,2003 CrystalClear Software, Inc.
- * Use, modification and distribution is subject to the
+ * Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
@@ -32,7 +32,7 @@
template<class date_type>
class date_itr_base {
// works, but benefit unclear at the moment
- // class date_itr_base : public std::iterator<std::input_iterator_tag,
+ // class date_itr_base : public std::iterator<std::input_iterator_tag,
// date_type, void, void, void>{
public:
typedef typename date_type::duration_type duration_type;
@@ -40,31 +40,31 @@
typedef std::input_iterator_tag iterator_category;
date_itr_base(date_type d) : current_(d) {}
- virtual ~date_itr_base() {};
- date_itr_base& operator++()
+ virtual ~date_itr_base() {}
+ date_itr_base& operator++()
{
current_ = current_ + get_offset(current_);
return *this;
}
- date_itr_base& operator--()
+ date_itr_base& operator--()
{
current_ = current_ + get_neg_offset(current_);
return *this;
}
virtual duration_type get_offset(const date_type& current) const=0;
virtual duration_type get_neg_offset(const date_type& current) const=0;
- date_type operator*() {return current_;};
- date_type* operator->() {return ¤t_;};
+ date_type operator*() {return current_;}
+ date_type* operator->() {return ¤t_;}
bool operator< (const date_type& d) {return current_ < d;}
bool operator<= (const date_type& d) {return current_ <= d;}
bool operator> (const date_type& d) {return current_ > d;}
bool operator>= (const date_type& d) {return current_ >= d;}
bool operator== (const date_type& d) {return current_ == d;}
- bool operator!= (const date_type& d) {return current_ != d;}
+ bool operator!= (const date_type& d) {return current_ != d;}
private:
date_type current_;
};
-
+
//! Overrides the base date iterator providing hook for functors
/*
* <b>offset_functor</b>
@@ -77,9 +77,9 @@
class date_itr : public date_itr_base<date_type> {
public:
typedef typename date_type::duration_type duration_type;
- date_itr(date_type d, int factor=1) :
- date_itr_base<date_type>(d),
- of_(factor)
+ date_itr(date_type d, int factor=1) :
+ date_itr_base<date_type>(d),
+ of_(factor)
{}
private:
virtual duration_type get_offset(const date_type& current) const
@@ -92,9 +92,9 @@
}
offset_functor of_;
};
-
-
+
+
} } //namespace date_time
Modified: trunk/boost/date_time/date_names_put.hpp
==============================================================================
--- trunk/boost/date_time/date_names_put.hpp (original)
+++ trunk/boost/date_time/date_names_put.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -2,10 +2,10 @@
#define DATE_TIME_DATE_NAMES_PUT_HPP___
/* Copyright (c) 2002-2005 CrystalClear Software, Inc.
- * Use, modification and distribution is subject to the
+ * Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
- * Author: Jeff Garland, Bart Garst
+ * Author: Jeff Garland, Bart Garst
* $Date$
*/
@@ -27,22 +27,22 @@
//! Output facet base class for gregorian dates.
/*! This class is a base class for date facets used to localize the
* names of months and the names of days in the week.
- *
+ *
* Requirements of Config
- * - define an enumeration month_enum that enumerates the months.
+ * - define an enumeration month_enum that enumerates the months.
* The enumeration should be '1' based eg: Jan==1
* - define as_short_string and as_long_string
*
* (see langer & kreft p334).
- *
+ *
*/
template<class Config,
- class charT = char,
+ class charT = char,
class OutputIterator = std::ostreambuf_iterator<charT> >
class date_names_put : public std::locale::facet
{
public:
- date_names_put() {};
+ date_names_put() {}
typedef OutputIterator iter_type;
typedef typename Config::month_type month_type;
typedef typename Config::month_enum month_enum;
@@ -118,7 +118,7 @@
put_string(oitr, gm.as_short_string(c));
}
//! Default facet implementation uses month_type defaults
- virtual void do_put_month_long(iter_type& oitr,
+ virtual void do_put_month_long(iter_type& oitr,
month_enum moy) const
{
month_type gm(moy);
@@ -160,7 +160,7 @@
string_type s(separator); //put in '-'
put_string(oitr, s);
}
- //! Default for date order
+ //! Default for date order
virtual ymd_order_spec do_date_order() const
{
return ymd_order_iso;
@@ -186,27 +186,27 @@
}
}
};
-
+
template<class Config, class charT, class OutputIterator>
- const typename date_names_put<Config, charT, OutputIterator>::char_type
- date_names_put<Config, charT, OutputIterator>::default_special_value_names[3][17] = {
+ const typename date_names_put<Config, charT, OutputIterator>::char_type
+ date_names_put<Config, charT, OutputIterator>::default_special_value_names[3][17] = {
{'n','o','t','-','a','-','d','a','t','e','-','t','i','m','e'},
{'-','i','n','f','i','n','i','t','y'},
{'+','i','n','f','i','n','i','t','y'} };
template<class Config, class charT, class OutputIterator>
- const typename date_names_put<Config, charT, OutputIterator>::char_type
- date_names_put<Config, charT, OutputIterator>::separator[2] =
+ const typename date_names_put<Config, charT, OutputIterator>::char_type
+ date_names_put<Config, charT, OutputIterator>::separator[2] =
{'-', '\0'} ;
-
- //! Generate storage location for a std::locale::id
+
+ //! Generate storage location for a std::locale::id
template<class Config, class charT, class OutputIterator>
std::locale::id date_names_put<Config, charT, OutputIterator>::id;
//! A date name output facet that takes an array of char* to define strings
template<class Config,
- class charT = char,
+ class charT = char,
class OutputIterator = std::ostreambuf_iterator<charT> >
class all_date_names_put : public date_names_put<Config, charT, OutputIterator>
{
@@ -230,29 +230,29 @@
separator_char_[0] = separator_char;
separator_char_[1] = '\0';
- };
+ }
typedef OutputIterator iter_type;
typedef typename Config::month_enum month_enum;
typedef typename Config::weekday_enum weekday_enum;
typedef typename Config::special_value_enum special_value_enum;
- const charT* const* get_short_month_names() const
+ const charT* const* get_short_month_names() const
{
return month_short_names_;
}
- const charT* const* get_long_month_names() const
+ const charT* const* get_long_month_names() const
{
return month_long_names_;
}
- const charT* const* get_special_value_names() const
+ const charT* const* get_special_value_names() const
{
return special_value_names_;
}
- const charT* const* get_short_weekday_names()const
+ const charT* const* get_short_weekday_names()const
{
return weekday_short_names_;
}
- const charT* const* get_long_weekday_names()const
+ const charT* const* get_long_weekday_names()const
{
return weekday_long_names_;
}
@@ -263,7 +263,7 @@
{
this->put_string(oitr, month_short_names_[moy-1]);
}
- //! Long month names
+ //! Long month names
virtual void do_put_month_long(iter_type& oitr, month_enum moy) const
{
this->put_string(oitr, month_long_names_[moy-1]);
@@ -310,7 +310,7 @@
const charT* const* weekday_long_names_;
charT separator_char_[2];
ymd_order_spec order_spec_;
- month_format_spec month_format_spec_;
+ month_format_spec month_format_spec_;
};
} } //namespace boost::date_time
Modified: trunk/boost/date_time/dst_rules.hpp
==============================================================================
--- trunk/boost/date_time/dst_rules.hpp (original)
+++ trunk/boost/date_time/dst_rules.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -371,7 +371,7 @@
return is_not_in_dst;
}
- static bool is_dst_boundary_day(date_type d)
+ static bool is_dst_boundary_day(date_type )
{
return false;
}
Modified: trunk/boost/date_time/dst_transition_generators.hpp
==============================================================================
--- trunk/boost/date_time/dst_transition_generators.hpp (original)
+++ trunk/boost/date_time/dst_transition_generators.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -18,7 +18,7 @@
{
public:
typedef typename date_type::year_type year_type;
- virtual ~dst_day_calc_rule() {};
+ virtual ~dst_day_calc_rule() {}
virtual date_type start_day(year_type y) const=0;
virtual std::string start_rule_as_string() const=0;
virtual date_type end_day(year_type y) const=0;
Modified: trunk/boost/date_time/local_time/custom_time_zone.hpp
==============================================================================
--- trunk/boost/date_time/local_time/custom_time_zone.hpp (original)
+++ trunk/boost/date_time/local_time/custom_time_zone.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -2,7 +2,7 @@
#define LOCAL_TIME_CUSTOM_TIME_ZONE_HPP__
/* Copyright (c) 2003-2005 CrystalClear Software, Inc.
- * Subject to the Boost Software License, Version 1.0.
+ * Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
* $Date$
@@ -34,8 +34,8 @@
typedef typename base_type::stringstream_type stringstream_type;
typedef date_time::time_zone_names_base<CharT> time_zone_names;
typedef CharT char_type;
-
- custom_time_zone_base(const time_zone_names& zone_names,
+
+ custom_time_zone_base(const time_zone_names& zone_names,
const time_duration_type& utc_offset,
const dst_adjustment_offsets& dst_shift,
boost::shared_ptr<dst_calc_rule> calc_rule) :
@@ -43,8 +43,8 @@
base_utc_offset_(utc_offset),
dst_offsets_(dst_shift),
dst_calc_rules_(calc_rule)
- {};
- virtual ~custom_time_zone_base() {};
+ {}
+ virtual ~custom_time_zone_base() {}
virtual string_type dst_zone_abbrev() const
{
return zone_names_.dst_zone_abbrev();
Modified: trunk/boost/date_time/local_time/local_date_time.hpp
==============================================================================
--- trunk/boost/date_time/local_time/local_date_time.hpp (original)
+++ trunk/boost/date_time/local_time/local_date_time.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -208,7 +208,7 @@
}
//! Simple destructor, releases time zone if last referrer
- ~local_date_time_base() {};
+ ~local_date_time_base() {}
//! Copy constructor
local_date_time_base(const local_date_time_base& rhs) :
Modified: trunk/boost/date_time/local_time/posix_time_zone.hpp
==============================================================================
--- trunk/boost/date_time/local_time/posix_time_zone.hpp (original)
+++ trunk/boost/date_time/local_time/posix_time_zone.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -115,7 +115,7 @@
calc_rules(dst_begin, dst_end);
}
}
- virtual ~posix_time_zone_base() {};
+ virtual ~posix_time_zone_base() {}
//!String for the zone when not in daylight savings (eg: EST)
virtual string_type std_zone_abbrev()const
{
Modified: trunk/boost/date_time/period_formatter.hpp
==============================================================================
--- trunk/boost/date_time/period_formatter.hpp (original)
+++ trunk/boost/date_time/period_formatter.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -114,10 +114,10 @@
{
m_range_option = option;
}
- void delimiter_strings(const string_type& separator,
- const string_type& start_delim,
- const string_type& open_end_delim,
- const string_type& closed_end_delim)
+ void delimiter_strings(const string_type& ,
+ const string_type& ,
+ const string_type& ,
+ const string_type& )
{
m_period_separator;
m_period_start_delimeter;
Modified: trunk/boost/date_time/time_duration.hpp
==============================================================================
--- trunk/boost/date_time/time_duration.hpp (original)
+++ trunk/boost/date_time/time_duration.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -2,7 +2,7 @@
#define DATE_TIME_TIME_DURATION_HPP___
/* Copyright (c) 2002,2003 CrystalClear Software, Inc.
- * Use, modification and distribution is subject to the
+ * Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
@@ -179,7 +179,7 @@
return duration_type(ticks_);
}
//! Division operations on a duration with an integer.
- duration_type operator/=(int divisor)
+ duration_type operator/=(int divisor)
{
ticks_ = ticks_ / divisor;
return duration_type(ticks_);
@@ -251,7 +251,7 @@
}
protected:
- explicit time_duration(impl_type in) : ticks_(in) {};
+ explicit time_duration(impl_type in) : ticks_(in) {}
impl_type ticks_;
};
Modified: trunk/boost/date_time/time_iterator.hpp
==============================================================================
--- trunk/boost/date_time/time_iterator.hpp (original)
+++ trunk/boost/date_time/time_iterator.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -2,7 +2,7 @@
#define DATE_TIME_TIME_ITERATOR_HPP___
/* Copyright (c) 2002,2003 CrystalClear Software, Inc.
- * Use, modification and distribution is subject to the
+ * Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
@@ -12,40 +12,40 @@
namespace boost {
namespace date_time {
-
+
//! Simple time iterator skeleton class
template<class time_type>
class time_itr {
public:
typedef typename time_type::time_duration_type time_duration_type;
- time_itr(time_type t, time_duration_type d) : current_(t), offset_(d) {};
- time_itr& operator++()
+ time_itr(time_type t, time_duration_type d) : current_(t), offset_(d) {}
+ time_itr& operator++()
{
current_ = current_ + offset_;
return *this;
}
- time_itr& operator--()
+ time_itr& operator--()
{
current_ = current_ - offset_;
return *this;
}
- time_type operator*() {return current_;};
- time_type* operator->() {return ¤t_;};
- bool operator< (const time_type& t) {return current_ < t;};
- bool operator<= (const time_type& t) {return current_ <= t;};
- bool operator!= (const time_type& t) {return current_ != t;};
- bool operator== (const time_type& t) {return current_ == t;};
- bool operator> (const time_type& t) {return current_ > t;};
- bool operator>= (const time_type& t) {return current_ >= t;};
-
+ time_type operator*() {return current_;}
+ time_type* operator->() {return ¤t_;}
+ bool operator< (const time_type& t) {return current_ < t;}
+ bool operator<= (const time_type& t) {return current_ <= t;}
+ bool operator!= (const time_type& t) {return current_ != t;}
+ bool operator== (const time_type& t) {return current_ == t;}
+ bool operator> (const time_type& t) {return current_ > t;}
+ bool operator>= (const time_type& t) {return current_ >= t;}
+
private:
time_type current_;
time_duration_type offset_;
};
-
-
+
+
} }//namespace date_time
Modified: trunk/boost/date_time/time_zone_base.hpp
==============================================================================
--- trunk/boost/date_time/time_zone_base.hpp (original)
+++ trunk/boost/date_time/time_zone_base.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -2,7 +2,7 @@
#define _DATE_TIME_TIME_ZONE_BASE__
/* Copyright (c) 2003-2005 CrystalClear Software, Inc.
- * Subject to the Boost Software License, Version 1.0.
+ * Subject to the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
* $Date$
@@ -26,9 +26,9 @@
* would be to convert from POSIX timezone strings. Regardless of
* the construction technique, this is the interface that these
* time zone types must provide.
- *
+ *
* Note that this class is intended to be used as a shared
- * resource (hence the derivation from boost::counted_base.
+ * resource (hence the derivation from boost::counted_base.
*/
template<typename time_type, typename CharT>
class time_zone_base {
@@ -39,8 +39,8 @@
typedef typename time_type::date_type::year_type year_type;
typedef typename time_type::time_duration_type time_duration_type;
- time_zone_base() {};
- virtual ~time_zone_base() {};
+ time_zone_base() {}
+ virtual ~time_zone_base() {}
//!String for the timezone when in daylight savings (eg: EDT)
virtual string_type dst_zone_abbrev() const=0;
//!String for the zone when not in daylight savings (eg: EST)
@@ -61,9 +61,9 @@
virtual time_duration_type dst_offset() const=0;
//! Returns a POSIX time_zone string for this object
virtual string_type to_posix_string() const =0;
-
+
private:
-
+
};
@@ -82,7 +82,7 @@
dst_start_offset_(dst_start_offset),
dst_end_offset_(dst_end_offset)
{}
-
+
//! Amount DST adjusts the clock eg: plus one hour
time_duration_type dst_adjust_;
//! Time past midnight on start transition day that dst starts
Modified: trunk/boost/date_time/wrapping_int.hpp
==============================================================================
--- trunk/boost/date_time/wrapping_int.hpp (original)
+++ trunk/boost/date_time/wrapping_int.hpp 2012-08-15 13:06:56 EDT (Wed, 15 Aug 2012)
@@ -2,7 +2,7 @@
#define _DATE_TIME_WRAPPING_INT_HPP__
/* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc.
- * Use, modification and distribution is subject to the
+ * Use, modification and distribution is subject to the
* Boost Software License, Version 1.0. (See accompanying
* file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
* Author: Jeff Garland, Bart Garst
@@ -16,15 +16,15 @@
//! A wrapping integer used to support time durations (WARNING: only instantiate with a signed type)
/*! In composite date and time types this type is used to
* wrap at the day boundary.
- * Ex:
- * A wrapping_int<short, 10> will roll over after nine, and
+ * Ex:
+ * A wrapping_int<short, 10> will roll over after nine, and
* roll under below zero. This gives a range of [0,9]
*
- * NOTE: it is strongly recommended that wrapping_int2 be used
- * instead of wrapping_int as wrapping_int is to be depricated
+ * NOTE: it is strongly recommended that wrapping_int2 be used
+ * instead of wrapping_int as wrapping_int is to be depricated
* at some point soon.
*
- * Also Note that warnings will occur if instantiated with an
+ * Also Note that warnings will occur if instantiated with an
* unsigned type. Only a signed type should be used!
*/
template<typename int_type_, int_type_ wrap_val>
@@ -34,17 +34,17 @@
//typedef overflow_type_ overflow_type;
static int_type wrap_value() {return wrap_val;}
//!Add, return true if wrapped
- wrapping_int(int_type v) : value_(v) {};
+ wrapping_int(int_type v) : value_(v) {}
//! Explicit converion method
int_type as_int() const {return value_;}
operator int_type() const {return value_;}
//!Add, return number of wraps performed
- /*! The sign of the returned value will indicate which direction the
+ /*! The sign of the returned value will indicate which direction the
* wraps went. Ex: add a negative number and wrapping under could occur,
- * this would be indicated by a negative return value. If wrapping over
+ * this would be indicated by a negative return value. If wrapping over
* took place, a positive value would be returned */
template< typename IntT >
- IntT add(IntT v)
+ IntT add(IntT v)
{
int_type remainder = static_cast<int_type>(v % (wrap_val));
IntT overflow = static_cast<IntT>(v / (wrap_val));
@@ -53,12 +53,12 @@
}
//! Subtract will return '+d' if wrapping under took place ('d' is the number of wraps)
/*! The sign of the returned value will indicate which direction the
- * wraps went (positive indicates wrap under, negative indicates wrap over).
- * Ex: subtract a negative number and wrapping over could
- * occur, this would be indicated by a negative return value. If
+ * wraps went (positive indicates wrap under, negative indicates wrap over).
+ * Ex: subtract a negative number and wrapping over could
+ * occur, this would be indicated by a negative return value. If
* wrapping under took place, a positive value would be returned. */
template< typename IntT >
- IntT subtract(IntT v)
+ IntT subtract(IntT v)
{
int_type remainder = static_cast<int_type>(v % (wrap_val));
IntT underflow = static_cast<IntT>(-(v / (wrap_val)));
@@ -71,19 +71,19 @@
template< typename IntT >
IntT calculate_wrap(IntT wrap)
{
- if ((value_) >= wrap_val)
+ if ((value_) >= wrap_val)
{
++wrap;
value_ -= (wrap_val);
}
- else if(value_ < 0)
+ else if(value_ < 0)
{
--wrap;
value_ += (wrap_val);
}
return wrap;
}
-
+
};
@@ -113,12 +113,12 @@
int_type as_int() const {return value_;}
operator int_type() const {return value_;}
//!Add, return number of wraps performed
- /*! The sign of the returned value will indicate which direction the
+ /*! The sign of the returned value will indicate which direction the
* wraps went. Ex: add a negative number and wrapping under could occur,
- * this would be indicated by a negative return value. If wrapping over
+ * this would be indicated by a negative return value. If wrapping over
* took place, a positive value would be returned */
template< typename IntT >
- IntT add(IntT v)
+ IntT add(IntT v)
{
int_type remainder = static_cast<int_type>(v % (wrap_max - wrap_min + 1));
IntT overflow = static_cast<IntT>(v / (wrap_max - wrap_min + 1));
@@ -127,30 +127,30 @@
}
//! Subtract will return '-d' if wrapping under took place ('d' is the number of wraps)
/*! The sign of the returned value will indicate which direction the
- * wraps went. Ex: subtract a negative number and wrapping over could
- * occur, this would be indicated by a positive return value. If
+ * wraps went. Ex: subtract a negative number and wrapping over could
+ * occur, this would be indicated by a positive return value. If
* wrapping under took place, a negative value would be returned */
template< typename IntT >
- IntT subtract(IntT v)
+ IntT subtract(IntT v)
{
int_type remainder = static_cast<int_type>(v % (wrap_max - wrap_min + 1));
IntT underflow = static_cast<IntT>(-(v / (wrap_max - wrap_min + 1)));
value_ = static_cast<int_type>(value_ - remainder);
return calculate_wrap(underflow);
}
-
+
private:
int_type value_;
template< typename IntT >
IntT calculate_wrap(IntT wrap)
{
- if ((value_) > wrap_max)
+ if ((value_) > wrap_max)
{
++wrap;
value_ -= (wrap_max - wrap_min + 1);
}
- else if((value_) < wrap_min)
+ else if((value_) < wrap_min)
{
--wrap;
value_ += (wrap_max - wrap_min + 1);
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