Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards


Class greg_month

boost::gregorian::greg_month — Wrapper class to represent months in gregorian based calendar.


// In header: <boost/date_time/gregorian/greg_month.hpp>

class greg_month : public greg_month_rep {
  // types
  typedef date_time::months_of_year month_enum;

  // construct/copy/destruct

  // public member functions
  BOOST_CXX14_CONSTEXPR operator value_type() const;
  BOOST_CXX14_CONSTEXPR value_type as_number() const;
  BOOST_CXX14_CONSTEXPR month_enum as_enum() const;
  const char * as_short_string() const;
  const char * as_long_string() const;
  const wchar_t * as_short_wstring() const;
  const wchar_t * as_long_wstring() const;
  const char * as_short_string(char) const;
  const char * as_long_string(char) const;
  const wchar_t * as_short_string(wchar_t) const;
  const wchar_t * as_long_string(wchar_t) const;


greg_month public construct/copy/destruct

  1. greg_month(month_enum theMonth);
    Construct a month from the months_of_year enumeration.
  2. greg_month(value_type theMonth);
    Construct from a short value.

greg_month public member functions

  1. BOOST_CXX14_CONSTEXPR operator value_type() const;
    Convert the value back to a short.
  2. BOOST_CXX14_CONSTEXPR value_type as_number() const;
    Returns month as number from 1 to 12.
  3. BOOST_CXX14_CONSTEXPR month_enum as_enum() const;
  4. const char * as_short_string() const;
    Returns 3 char english string for the month ex: Jan, Feb, Mar, Apr.
  5. const char * as_long_string() const;
    Returns full name of month as string in english ex: January, February.
  6. const wchar_t * as_short_wstring() const;
    Returns 3 wchar_t english string for the month ex: Jan, Feb, Mar, Apr.
  7. const wchar_t * as_long_wstring() const;
    Returns full name of month as wchar_t string in english ex: January, February.
  8. const char * as_short_string(char) const;
  9. const char * as_long_string(char) const;
  10. const wchar_t * as_short_string(wchar_t) const;
  11. const wchar_t * as_long_string(wchar_t) const;