Boost-Graph

 view release on metacpan or  search on metacpan

include/boost/date_time/time_facet.hpp  view on Meta::CPAN


#ifndef _DATE_TIME_FACET__HPP__
#define _DATE_TIME_FACET__HPP__

/* Copyright (c) 2004-2005 CrystalClear Software, Inc.
 * Use, modification and distribution is subject to the 
 * Boost Software License, Version 1.0. (See accompanying
 * file LICENSE-1.0 or http://www.boost.org/LICENSE-1.0)
 * Author:  Martin Andrian, Jeff Garland, Bart Garst
 * $Date: 2005/07/17 23:57:59 $
 */

#include "boost/date_time/date_facet.hpp"
#include "boost/date_time/string_convert.hpp"
#include "boost/algorithm/string/erase.hpp"
#include <sstream>
#include <iomanip>
#include <exception>

namespace boost {
namespace date_time {

  template <class CharT>
  struct time_formats {
    public:
      typedef CharT char_type;
      static const char_type fractional_seconds_format[3];               // f
      static const char_type fractional_seconds_or_none_format[3];       // F
      static const char_type seconds_with_fractional_seconds_format[3];  // s
      static const char_type seconds_format[3];                          // S
      static const char_type standard_format[9];                         // x X
      static const char_type zone_abbrev_format[3];                      // z
      static const char_type zone_name_format[3];                        // Z
      static const char_type zone_iso_format[3];                         // q
      static const char_type zone_iso_extended_format[3];                // Q
      static const char_type posix_zone_string_format[4];                // ZP
      static const char_type duration_sign_negative_only[3];             // -
      static const char_type duration_sign_always[3];                    // +
      static const char_type duration_seperator[2];
      static const char_type negative_sign[2];                           //-
      static const char_type positive_sign[2];                           //+
      static const char_type iso_time_format_specifier[18];
      static const char_type iso_time_format_extended_specifier[22];
      //default ptime format is YYYY-Mon-DD HH:MM:SS[.fff...][ zzz]
      static const char_type default_time_format[23]; 
      // default_time_input_format uses a posix_time_zone_string instead of a time zone abbrev
      static const char_type default_time_input_format[24]; 
      //default time_duration format is HH:MM:SS[.fff...]
      static const char_type default_time_duration_format[11];
  };

  template <class CharT>  
  const typename time_formats<CharT>::char_type 
  time_formats<CharT>::fractional_seconds_format[3] = {'%','f'};

  template <class CharT>  
  const typename time_formats<CharT>::char_type 
  time_formats<CharT>::fractional_seconds_or_none_format[3] = {'%','F'};

  template <class CharT>  
  const typename time_formats<CharT>::char_type 
  time_formats<CharT>::seconds_with_fractional_seconds_format[3] = 
    {'%','s'};



( run in 0.700 second using v1.01-cache-2.11-cpan-39bf76dae61 )