Boost.Locale
I/O Stream manipulators

Functions

std::ios_base & boost::locale::as::posix (std::ios_base &ios)
 
std::ios_base & boost::locale::as::number (std::ios_base &ios)
 
std::ios_base & boost::locale::as::currency (std::ios_base &ios)
 
std::ios_base & boost::locale::as::percent (std::ios_base &ios)
 
std::ios_base & boost::locale::as::date (std::ios_base &ios)
 
std::ios_base & boost::locale::as::time (std::ios_base &ios)
 
std::ios_base & boost::locale::as::datetime (std::ios_base &ios)
 
std::ios_base & boost::locale::as::strftime (std::ios_base &ios)
 
std::ios_base & boost::locale::as::spellout (std::ios_base &ios)
 
std::ios_base & boost::locale::as::ordinal (std::ios_base &ios)
 
std::ios_base & boost::locale::as::currency_default (std::ios_base &ios)
 
std::ios_base & boost::locale::as::currency_iso (std::ios_base &ios)
 
std::ios_base & boost::locale::as::currency_national (std::ios_base &ios)
 
std::ios_base & boost::locale::as::time_default (std::ios_base &ios)
 
std::ios_base & boost::locale::as::time_short (std::ios_base &ios)
 
std::ios_base & boost::locale::as::time_medium (std::ios_base &ios)
 
std::ios_base & boost::locale::as::time_long (std::ios_base &ios)
 
std::ios_base & boost::locale::as::time_full (std::ios_base &ios)
 
std::ios_base & boost::locale::as::date_default (std::ios_base &ios)
 
std::ios_base & boost::locale::as::date_short (std::ios_base &ios)
 
std::ios_base & boost::locale::as::date_medium (std::ios_base &ios)
 
std::ios_base & boost::locale::as::date_long (std::ios_base &ios)
 
std::ios_base & boost::locale::as::date_full (std::ios_base &ios)
 
template<typename CharType >
unspecified_type boost::locale::as::ftime (std::basic_string< CharType > const &format)
 
template<typename CharType >
unspecified_type boost::locale::as::ftime (CharType const *format)
 
std::ios_base & boost::locale::as::gmt (std::ios_base &ios)
 
std::ios_base & boost::locale::as::local_time (std::ios_base &ios)
 
unspecified_type boost::locale::as::time_zone (char const *id)
 
unspecified_type boost::locale::as::time_zone (std::string const &id)
 
unspecified_type boost::locale::as::domain (std::string const &id)
 

Detailed Description

Function Documentation

std::ios_base& boost::locale::as::currency ( std::ios_base &  ios)
inline

Format currency, number is treated like amount of money

Examples:
hello.cpp, and whello.cpp.
std::ios_base& boost::locale::as::currency_default ( std::ios_base &  ios)
inline

Set default currency formatting style – national, like "$"

std::ios_base& boost::locale::as::currency_iso ( std::ios_base &  ios)
inline

Set ISO currency formatting style, like "USD", (requires ICU >= 4.2)

std::ios_base& boost::locale::as::currency_national ( std::ios_base &  ios)
inline

Set national currency formatting style, like "$"

std::ios_base& boost::locale::as::date ( std::ios_base &  ios)
inline

Format a date, number is treated as POSIX time

Examples:
hello.cpp, and whello.cpp.
std::ios_base& boost::locale::as::date_default ( std::ios_base &  ios)
inline

set default (medium) date formatting style

std::ios_base& boost::locale::as::date_full ( std::ios_base &  ios)
inline

set full date formatting style

std::ios_base& boost::locale::as::date_long ( std::ios_base &  ios)
inline

set long date formatting style

std::ios_base& boost::locale::as::date_medium ( std::ios_base &  ios)
inline

set medium date formatting style

std::ios_base& boost::locale::as::date_short ( std::ios_base &  ios)
inline

set short date formatting style

std::ios_base& boost::locale::as::datetime ( std::ios_base &  ios)
inline

Format a date and time, number is treated as POSIX time

unspecified_type boost::locale::as::domain ( std::string const &  id)
inline

Manipulator for switching message domain in ostream,

Note
The returned object throws std::bad_cast if the I/O stream does not have message_format facet installed
template<typename CharType >
unspecified_type boost::locale::as::ftime ( std::basic_string< CharType > const &  format)

Set strftime like formatting string

Please note, formatting flags are very similar but not exactly the same as flags for C function strftime. Differences: some flags as "%e" do not add blanks to fill text up to two spaces, not all flags supported.

Flags:

  • "%a" – Abbreviated weekday (Sun.)
  • "%A" – Full weekday (Sunday)
  • "%b" – Abbreviated month (Jan.)
  • "%B" – Full month (January)
  • "%c" – Locale date-time format. Note: prefer using "as::datetime"
  • "%d" – Day of Month [01,31]
  • "%e" – Day of Month [1,31]
  • "%h" – Same as "%b"
  • "%H" – 24 clock hour [00,23]
  • "%I" – 12 clock hour [01,12]
  • "%j" – Day of year [1,366]
  • "%m" – Month [01,12]
  • "%M" – Minute [00,59]
  • "%n" – New Line
  • "%p" – AM/PM in locale representation
  • "%r" – Time with AM/PM, same as "%I:%M:%S %p"
  • "%R" – Same as "%H:%M"
  • "%S" – Second [00,61]
  • "%t" – Tab character
  • "%T" – Same as "%H:%M:%S"
  • "%x" – Local date representation. Note: prefer using "as::date"
  • "%X" – Local time representation. Note: prefer using "as::time"
  • "%y" – Year [00,99]
  • "%Y" – 4 digits year. (2009)
  • "%Z" – Time Zone
  • "%%" – Percent symbol
template<typename CharType >
unspecified_type boost::locale::as::ftime ( CharType const *  format)
std::ios_base& boost::locale::as::gmt ( std::ios_base &  ios)
inline

Set GMT time zone to stream

std::ios_base& boost::locale::as::local_time ( std::ios_base &  ios)
inline

Set local time zone to stream

std::ios_base& boost::locale::as::number ( std::ios_base &  ios)
inline

Format a number. Note, unlike standard number formatting, integers would be treated like real numbers when std::fixed or std::scientific manipulators were applied

Examples:
hello.cpp, and whello.cpp.
std::ios_base& boost::locale::as::ordinal ( std::ios_base &  ios)
inline

Write an order of the number like 4th.

std::ios_base& boost::locale::as::percent ( std::ios_base &  ios)
inline

Format percent, value 0.3 is treated as 30%.

std::ios_base& boost::locale::as::posix ( std::ios_base &  ios)
inline

Format values with "POSIX" or "C" locale. Note, if locale was created with additional non-classic locale then These numbers may be localized

std::ios_base& boost::locale::as::spellout ( std::ios_base &  ios)
inline

Spell the number, like "one hundred and ten"

std::ios_base& boost::locale::as::strftime ( std::ios_base &  ios)
inline

Create formatted date time, Please note, this manipulator only changes formatting mode, and not format itself, so you are probably looking for ftime manipulator

std::ios_base& boost::locale::as::time ( std::ios_base &  ios)
inline

Format a time, number is treated as POSIX time

Examples:
hello.cpp, and whello.cpp.
std::ios_base& boost::locale::as::time_default ( std::ios_base &  ios)
inline

set default (medium) time formatting style

std::ios_base& boost::locale::as::time_full ( std::ios_base &  ios)
inline

set full time formatting style

std::ios_base& boost::locale::as::time_long ( std::ios_base &  ios)
inline

set long time formatting style

std::ios_base& boost::locale::as::time_medium ( std::ios_base &  ios)
inline

set medium time formatting style

std::ios_base& boost::locale::as::time_short ( std::ios_base &  ios)
inline

set short time formatting style

unspecified_type boost::locale::as::time_zone ( char const *  id)
inline

Set time zone using id

unspecified_type boost::locale::as::time_zone ( std::string const &  id)
inline

Set time zone using id