Date formats using locale


Functions

const locale * eepgwde::detail::dating (const std::locale &ours)
void eepgwde::detail::Typing::set (const std::locale &ours) throw (std::domain_error)
 Set the LC_TIME part of the global locale to be as given by the @ ours locale.
const std::locale & eepgwde::detail::Typing::get () throw (std::domain_error)
 Get the global locale and see if it matches any of the.

Variables

static const locale eepgwde::detail::Typing::posix = locale(locale::classic(), locale("POSIX"), locale::time)
static const locale eepgwde::detail::Typing::us = locale(locale::classic(), locale("en_US"), locale::time)
static const locale eepgwde::detail::Typing::uk = locale(locale::classic(), locale("en_GB"), locale::time)

Detailed Description

Find if our locale matches a well-known one.

We only test the LC_TIME attribute. We don't check for UTF or any of the other variants.

There is a complication with input dates. They can be POSIX, UK or US style. Distinguishes between date formats.


Function Documentation

const locale* eepgwde::detail::dating ( const std::locale &  ours  ) 

const std::locale & eepgwde::detail::Typing::get (  )  throw (std::domain_error) [inherited]

Get the global locale and see if it matches any of the.

Get the current locale of the program and compare it to the accepted date formats and return the match.

Otherwise throw an exception.

Note:
To ensure success use Typing::set and Typing::posix or similar.

Definition at line 187 of file runtime2.cpp.

References eepgwde::detail::dating().

Referenced by Test::date0_t::date0::locale0(), Test::date1_t::date1::tas2(), and Test::date1_t::date1::tas3().

void eepgwde::detail::Typing::set ( const std::locale &  ours  )  throw (std::domain_error) [inherited]

Set the LC_TIME part of the global locale to be as given by the @ ours locale.

Given a locale, take the LC_TIME attribute for it and copy it into the program locale.

Definition at line 176 of file runtime2.cpp.

Referenced by Test::date0_t::date0::locale0(), Test::date1_t::date1::tas2(), and Test::date1_t::date1::tas3().


Variable Documentation

const locale eepgwde::detail::Typing::posix = locale(locale::classic(), locale("POSIX"), locale::time) [static, inherited]

Definition at line 108 of file runtime2.hpp.

Referenced by eepgwde::detail::locale_trier().

const locale eepgwde::detail::Typing::uk = locale(locale::classic(), locale("en_GB"), locale::time) [static, inherited]

Definition at line 110 of file runtime2.hpp.

Referenced by eepgwde::detail::locale_trier().

const locale eepgwde::detail::Typing::us = locale(locale::classic(), locale("en_US"), locale::time) [static, inherited]

Definition at line 109 of file runtime2.hpp.

Referenced by eepgwde::detail::locale_trier().


Generated on Thu Feb 18 21:30:12 2010 for eleve by  doxygen 1.5.6