/usr/include/boost/date_time
NameSizeModeActions
gregorian/-0755rm
local_time/-0755rm
posix_time/-0755rm
adjust_functors.hpp54670644editdlrm
compiler_config.hpp56400644editdlrm
constrained_value.hpp42240644editdlrm
c_local_time_adjustor.hpp26310644editdlrm
c_time.hpp44960644editdlrm
date.hpp73570644editdlrm
date_clock_device.hpp22990644editdlrm
date_defs.hpp7010644editdlrm
date_duration.hpp46690644editdlrm
date_duration_types.hpp91860644editdlrm
date_facet.hpp293140644editdlrm
date_formatting.hpp42080644editdlrm
date_formatting_limited.hpp34610644editdlrm
date_formatting_locales.hpp67480644editdlrm
date_format_simple.hpp31280644editdlrm
date_generators.hpp165080644editdlrm
date_generator_formatter.hpp117150644editdlrm
date_generator_parser.hpp130640644editdlrm
date_iterator.hpp33050644editdlrm
date_names_put.hpp107540644editdlrm
date_parsing.hpp141460644editdlrm
dst_rules.hpp154010644editdlrm
dst_transition_generators.hpp22930644editdlrm
filetime_functions.hpp31630644editdlrm
find_match.hpp13550644editdlrm
format_date_parser.hpp239090644editdlrm
gregorian_calendar.hpp27140644editdlrm
gregorian_calendar.ipp79470644editdlrm
int_adapter.hpp144630644editdlrm
iso_format.hpp56400644editdlrm
locale_config.hpp12060644editdlrm
local_timezone_defs.hpp76180644editdlrm
local_time_adjustor.hpp85780644editdlrm
microsec_time_clock.hpp62570644editdlrm
parse_format_base.hpp9610644editdlrm
period.hpp119360644editdlrm
period_formatter.hpp72370644editdlrm
period_parser.hpp79320644editdlrm
special_defs.hpp6330644editdlrm
special_values_formatter.hpp36570644editdlrm
special_values_parser.hpp61610644editdlrm
strings_from_facet.hpp45050644editdlrm
string_convert.hpp10020644editdlrm
string_parse_tree.hpp84050644editdlrm
time.hpp67880644editdlrm
time_clock.hpp22450644editdlrm
time_defs.hpp9420644editdlrm
time_duration.hpp105690644editdlrm
time_facet.hpp589880644editdlrm
time_formatting_streams.hpp37520644editdlrm
time_iterator.hpp14380644editdlrm
time_parsing.hpp118460644editdlrm
time_resolution_traits.hpp67600644editdlrm
time_system_counted.hpp90510644editdlrm
time_system_split.hpp80770644editdlrm
time_zone_base.hpp37110644editdlrm
time_zone_names.hpp31030644editdlrm
tz_db_base.hpp159150644editdlrm
wrapping_int.hpp58240644editdlrm
year_month_day.hpp13750644editdlrm
Edit: /usr/include/boost/date_time/date_formatting.hpp (4208B)
#ifndef DATE_TIME_DATE_FORMATTING_HPP___ #define DATE_TIME_DATE_FORMATTING_HPP___ /* Copyright (c) 2002-2004 CrystalClear Software, Inc. * 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 * $Date$ */ #include "boost/date_time/iso_format.hpp" #include "boost/date_time/compiler_config.hpp" #include #include #include #include /* NOTE: "formatter" code for older compilers, ones that define * BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS, is located in * date_formatting_limited.hpp */ namespace boost { namespace date_time { //! Formats a month as as string into an ostream template class month_formatter { typedef std::basic_ostream ostream_type; public: //! Formats a month as as string into an ostream /*! This function demands that month_type provide * functions for converting to short and long strings * if that capability is used. */ static ostream_type& format_month(const month_type& month, ostream_type &os) { switch (format_type::month_format()) { case month_as_short_string: { os << month.as_short_string(); break; } case month_as_long_string: { os << month.as_long_string(); break; } case month_as_integer: { boost::io::basic_ios_fill_saver ifs(os); os << std::setw(2) << std::setfill(os.widen('0')) << month.as_number(); break; } default: break; } return os; } // format_month }; //! Convert ymd to a standard string formatting policies template class ymd_formatter { public: //! Convert ymd to a standard string formatting policies /*! This is standard code for handling date formatting with * year-month-day based date information. This function * uses the format_type to control whether the string will * contain separator characters, and if so what the character * will be. In addtion, it can format the month as either * an integer or a string as controled by the formatting * policy */ static std::basic_string ymd_to_string(ymd_type ymd) { typedef typename ymd_type::month_type month_type; std::basic_ostringstream ss; // Temporarily switch to classic locale to prevent possible formatting // of year with comma or other character (for example 2,008). ss.imbue(std::locale::classic()); ss << ymd.year; ss.imbue(std::locale()); if (format_type::has_date_sep_chars()) { ss << format_type::month_sep_char(); } //this name is a bit ugly, oh well.... month_formatter::format_month(ymd.month, ss); if (format_type::has_date_sep_chars()) { ss << format_type::day_sep_char(); } ss << std::setw(2) << std::setfill(ss.widen('0')) << ymd.day; return ss.str(); } }; //! Convert a date to string using format policies template class date_formatter { public: typedef std::basic_string string_type; //! Convert to a date to standard string using format policies static string_type date_to_string(date_type d) { typedef typename date_type::ymd_type ymd_type; if (d.is_not_a_date()) { return string_type(format_type::not_a_date()); } if (d.is_neg_infinity()) { return string_type(format_type::neg_infinity()); } if (d.is_pos_infinity()) { return string_type(format_type::pos_infinity()); } ymd_type ymd = d.year_month_day(); return ymd_formatter::ymd_to_string(ymd); } }; } } //namespace date_time #endif