Functions | |
namespace std | _GLIBCXX_VISIBILITY (default) |
Classes and functions for internationalization and localization.
namespace std _GLIBCXX_VISIBILITY | ( | default | ) |
Empty base class for codecvt facet [22.2.1.5].
Common base for codecvt functions.
This template class provides implementations of the public functions that forward to the protected virtual functions.
This template also provides abstract stubs for the protected virtual functions.
Convert from internal to external character set.
Converts input string of intern_type to output string of extern_type. This is analogous to wcsrtombs. It does this by calling codecvt::do_out.
The source and destination character sets are determined by the facet's locale, internal and external types.
The characters in [from,from_end) are converted and written to [to,to_end). from_next and to_next are set to point to the character following the last successfully converted character, respectively. If the result needed no conversion, from_next and to_next are not affected.
The state argument should be initialized if the input is at the beginning and carried from a previous call if continuing conversion. There are no guarantees about how state is used.
The result returned is a member of codecvt_base::result. If all the input is converted, returns codecvt_base::ok. If no conversion is necessary, returns codecvt_base::noconv. If the input ends early or there is insufficient space in the output, returns codecvt_base::partial. Otherwise the conversion failed and codecvt_base::error is returned.
__state | Persistent conversion state data. |
__from | Start of input. |
__from_end | End of input. |
__from_next | Returns start of unconverted data. |
__to | Start of output buffer. |
__to_end | End of output buffer. |
__to_next | Returns start of unused output area. |
Reset conversion state.
Writes characters to output that would restore state to initial conditions. The idea is that if a partial conversion occurs, then the converting the characters written by this function would leave the state in initial conditions, rather than partial conversion state. It does this by calling codecvt::do_unshift().
For example, if 4 external characters always converted to 1 internal character, and input to in() had 6 external characters with state saved, this function would write two characters to the output and set the state to initialized conditions.
The source and destination character sets are determined by the facet's locale, internal and external types.
The result returned is a member of codecvt_base::result. If the state could be reset and data written, returns codecvt_base::ok. If no conversion is necessary, returns codecvt_base::noconv. If the output has insufficient space, returns codecvt_base::partial. Otherwise the reset failed and codecvt_base::error is returned.
__state | Persistent conversion state data. |
__to | Start of output buffer. |
__to_end | End of output buffer. |
__to_next | Returns start of unused output area. |
Convert from external to internal character set.
Converts input string of extern_type to output string of intern_type. This is analogous to mbsrtowcs. It does this by calling codecvt::do_in.
The source and destination character sets are determined by the facet's locale, internal and external types.
The characters in [from,from_end) are converted and written to [to,to_end). from_next and to_next are set to point to the character following the last successfully converted character, respectively. If the result needed no conversion, from_next and to_next are not affected.
The state argument should be initialized if the input is at the beginning and carried from a previous call if continuing conversion. There are no guarantees about how state is used.
The result returned is a member of codecvt_base::result. If all the input is converted, returns codecvt_base::ok. If no conversion is necessary, returns codecvt_base::noconv. If the input ends early or there is insufficient space in the output, returns codecvt_base::partial. Otherwise the conversion failed and codecvt_base::error is returned.
__state | Persistent conversion state data. |
__from | Start of input. |
__from_end | End of input. |
__from_next | Returns start of unconverted data. |
__to | Start of output buffer. |
__to_end | End of output buffer. |
__to_next | Returns start of unused output area. |
Convert from internal to external character set.
Converts input string of intern_type to output string of extern_type. This function is a hook for derived classes to change the value returned.
Primary class template codecvt.
NB: Generic, mostly useless implementation.
class codecvt<char, char, mbstate_t> specialization.
class codecvt_byname [22.2.1.6].
Container class for localization functionality.
The locale class is first a class wrapper for C library locales. It is also an extensible container for user-defined localization. A locale is a collection of facets that implement various localization features such as money, time, and number printing.
Constructing C++ locales does not change the C library locale.
This library supports efficient construction and copying of locales through a reference counting implementation of the locale class.
Definition of locale::category.
Category values.
The standard category values are none, ctype, numeric, collate, time, monetary, and messages. They form a bitmask that supports union and intersection. The category all is the union of these values.
NB: Order must match _S_facet_categories definition in locale.cc
Default constructor.
Constructs a copy of the global locale. If no locale has been explicitly set, this is the C locale.
Copy constructor.
Constructs a copy of other.
__other | The locale to copy. |
Named locale constructor.
Constructs a copy of the named C library locale.
__s | Name of the locale to construct. |
std::runtime_error | if __s is null or an undefined locale. |
Construct locale with facets from another locale.
Constructs a copy of the locale base. The facets specified by cat are replaced with those from the locale named by s. If base is named, this locale instance will also be named.
__base | The locale to copy. |
__s | Name of the locale to use facets from. |
__cat | Set of categories defining the facets to use from __s. |
std::runtime_error | if __s is null or an undefined locale. |
Construct locale with facets from another locale.
Constructs a copy of the locale base. The facets specified by cat are replaced with those from the locale add. If base and add are named, this locale instance will also be named.
__base | The locale to copy. |
__add | The locale to use facets from. |
__cat | Set of categories defining the facets to use from add. |
Construct locale with another facet.
Constructs a copy of the locale __other. The facet __f is added to __other, replacing an existing facet of type Facet if there is one. If __f is null, this locale is a copy of __other.
__other | The locale to copy. |
__f | The facet to add in. |
Locale destructor.
Assignment operator.
Set this locale to be a copy of other.
__other | The locale to copy. |
Construct locale with another facet.
Constructs and returns a new copy of this locale. Adds or replaces an existing facet of type Facet from the locale other into the new locale.
_Facet | The facet type to copy from other |
__other | The locale to copy from. |
std::runtime_error | if __other has no facet of type _Facet. |
Return locale name.
Locale equality.
__other | The locale to compare against. |
Locale inequality.
__other | The locale to compare against. |
Compare two strings according to collate.
Template operator to compare two strings using the compare function of the collate facet in this locale. One use is to provide the locale to the sort function. For example, a vector v of strings could be sorted according to locale loc by doing:
__s1 | First string to compare. |
__s2 | Second string to compare. |
Set global locale
This function sets the global locale to the argument and returns a copy of the previous global locale. If the argument has a name, it will also call std::setlocale(LC_ALL, loc.name()).
__loc | The new locale to make global. |
Return reference to the C locale.
Localization functionality base class.
The facet class is the base class for a localization feature, such as money, time, and number printing. It provides common support for facets and reference management.
Facets may not be copied or assigned.
Facet constructor.
This is the constructor provided by the standard. If refs is 0, the facet is destroyed when the last referencing locale is destroyed. Otherwise the facet will never be destroyed.
__refs | The initial value for reference count. |
Facet destructor.
Facet ID class.
The ID class provides facets with an index used to identify them. Every facet class must define a public static member locale::id, or be derived from a facet that provides this member, otherwise the facet cannot be used in a locale. The locale::id ensures that each class type gets a unique identifier.
Constructor.
Facet for localized string comparison.
This facet encapsulates the code to compare strings in a localized manner.
The collate template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the collate facet.
Public typedefs
Numpunct facet id.
Constructor performs initialization.
This is the constructor provided by the standard.
__refs | Passed to the base facet class. |
Internal constructor. Not for general use.
This is a constructor for use by the library itself to set up new locales.
__cloc | The C locale. |
__refs | Passed to the base facet class. |
Compare two strings.
This function compares two strings and returns the result by calling collate::do_compare().
__lo1 | Start of string 1. |
__hi1 | End of string 1. |
__lo2 | Start of string 2. |
__hi2 | End of string 2. |
Transform string to comparable form.
This function is a wrapper for strxfrm functionality. It takes the input string and returns a modified string that can be directly compared to other transformed strings. In the C locale, this function just returns a copy of the input string. In some other locales, it may replace two chars with one, change a char for another, etc. It does so by returning collate::do_transform().
__lo | Start of string. |
__hi | End of string. |
Return hash of a string.
This function computes and returns a hash on the input string. It does so by returning collate::do_hash().
__lo | Start of string. |
__hi | End of string. |
Destructor.
Compare two strings.
This function is a hook for derived classes to change the value returned.
__lo1 | Start of string 1. |
__hi1 | End of string 1. |
__lo2 | Start of string 2. |
__hi2 | End of string 2. |
Transform string to comparable form.
This function is a hook for derived classes to change the value returned.
__lo | Start. |
__hi | End. |
Return hash of a string.
This function computes and returns a hash on the input string. This function is a hook for derived classes to change the value returned.
__lo | Start of string. |
__hi | End of string. |
class collate_byname [22.2.4.2].
Public typedefs
Common base for ctype facet
This template class provides implementations of the public functions that forward to the protected virtual functions.
This template also provides abstract stubs for the protected virtual functions.
Typedef for the template parameter
Test char_type classification.
This function finds a mask M for __c and compares it to mask __m. It does so by returning the value of ctype<char_type>::do_is().
__c | The char_type to compare the mask of. |
__m | The mask to compare against. |
Return a mask array.
This function finds the mask for each char_type in the range [lo,hi) and successively writes it to vec. vec must have as many elements as the char array. It does so by returning the value of ctype<char_type>::do_is().
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
__vec | Pointer to an array of mask storage. |
Find char_type matching a mask
This function searches for and returns the first char_type c in [lo,hi) for which is(m,c) is true. It does so by returning ctype<char_type>::do_scan_is().
__m | The mask to compare against. |
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
Find char_type not matching a mask
This function searches for and returns the first char_type c in [lo,hi) for which is(m,c) is false. It does so by returning ctype<char_type>::do_scan_not().
__m | The mask to compare against. |
__lo | Pointer to first char in range. |
__hi | Pointer to end of range. |
Convert to uppercase.
This function converts the argument to uppercase if possible. If not possible (for example, '2'), returns the argument. It does so by returning ctype<char_type>::do_toupper().
__c | The char_type to convert. |
Convert array to uppercase.
This function converts each char_type in the range [lo,hi) to uppercase if possible. Other elements remain untouched. It does so by returning ctype<char_type>:: do_toupper(lo, hi).
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
Convert to lowercase.
This function converts the argument to lowercase if possible. If not possible (for example, '2'), returns the argument. It does so by returning ctype<char_type>::do_tolower(c).
__c | The char_type to convert. |
Convert array to lowercase.
This function converts each char_type in the range [__lo,__hi) to lowercase if possible. Other elements remain untouched. It does so by returning ctype<char_type>:: do_tolower(__lo, __hi).
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
Widen char to char_type
This function converts the char argument to char_type using the simplest reasonable transformation. It does so by returning ctype<char_type>::do_widen(c).
Note: this is not what you want for codepage conversions. See codecvt for that.
__c | The char to convert. |
Widen array to char_type
This function converts each char in the input to char_type using the simplest reasonable transformation. It does so by returning ctype<char_type>::do_widen(c).
Note: this is not what you want for codepage conversions. See codecvt for that.
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
__to | Pointer to the destination array. |
Narrow char_type to char
This function converts the char_type to char using the simplest reasonable transformation. If the conversion fails, dfault is returned instead. It does so by returning ctype<char_type>::do_narrow(__c).
Note: this is not what you want for codepage conversions. See codecvt for that.
__c | The char_type to convert. |
__dfault | Char to return if conversion fails. |
Narrow array to char array
This function converts each char_type in the input to char using the simplest reasonable transformation and writes the results to the destination array. For any char_type in the input that cannot be converted, dfault is used instead. It does so by returning ctype<char_type>::do_narrow(__lo, __hi, __dfault, __to).
Note: this is not what you want for codepage conversions. See codecvt for that.
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
__dfault | Char to use if conversion fails. |
__to | Pointer to the destination array. |
Test char_type classification.
This function finds a mask M for c and compares it to mask m.
do_is() is a hook for a derived facet to change the behavior of classifying. do_is() must always return the same result for the same input.
__c | The char_type to find the mask of. |
__m | The mask to compare against. |
Return a mask array.
This function finds the mask for each char_type in the range [lo,hi) and successively writes it to vec. vec must have as many elements as the input.
do_is() is a hook for a derived facet to change the behavior of classifying. do_is() must always return the same result for the same input.
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
__vec | Pointer to an array of mask storage. |
Find char_type matching mask
This function searches for and returns the first char_type c in [__lo,__hi) for which is(__m,c) is true.
do_scan_is() is a hook for a derived facet to change the behavior of match searching. do_is() must always return the same result for the same input.
__m | The mask to compare against. |
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
Find char_type not matching mask
This function searches for and returns a pointer to the first char_type c of [lo,hi) for which is(m,c) is false.
do_scan_is() is a hook for a derived facet to change the behavior of match searching. do_is() must always return the same result for the same input.
__m | The mask to compare against. |
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
Convert to uppercase.
This virtual function converts the char_type argument to uppercase if possible. If not possible (for example, '2'), returns the argument.
do_toupper() is a hook for a derived facet to change the behavior of uppercasing. do_toupper() must always return the same result for the same input.
__c | The char_type to convert. |
Convert array to uppercase.
This virtual function converts each char_type in the range [__lo,__hi) to uppercase if possible. Other elements remain untouched.
do_toupper() is a hook for a derived facet to change the behavior of uppercasing. do_toupper() must always return the same result for the same input.
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
Convert to lowercase.
This virtual function converts the argument to lowercase if possible. If not possible (for example, '2'), returns the argument.
do_tolower() is a hook for a derived facet to change the behavior of lowercasing. do_tolower() must always return the same result for the same input.
__c | The char_type to convert. |
Convert array to lowercase.
This virtual function converts each char_type in the range [__lo,__hi) to lowercase if possible. Other elements remain untouched.
do_tolower() is a hook for a derived facet to change the behavior of lowercasing. do_tolower() must always return the same result for the same input.
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
Widen char
This virtual function converts the char to char_type using the simplest reasonable transformation.
do_widen() is a hook for a derived facet to change the behavior of widening. do_widen() must always return the same result for the same input.
Note: this is not what you want for codepage conversions. See codecvt for that.
__c | The char to convert. |
Widen char array
This function converts each char in the input to char_type using the simplest reasonable transformation.
do_widen() is a hook for a derived facet to change the behavior of widening. do_widen() must always return the same result for the same input.
Note: this is not what you want for codepage conversions. See codecvt for that.
__lo | Pointer to start range. |
__hi | Pointer to end of range. |
__to | Pointer to the destination array. |
Narrow char_type to char
This virtual function converts the argument to char using the simplest reasonable transformation. If the conversion fails, dfault is returned instead.
do_narrow() is a hook for a derived facet to change the behavior of narrowing. do_narrow() must always return the same result for the same input.
Note: this is not what you want for codepage conversions. See codecvt for that.
__c | The char_type to convert. |
__dfault | Char to return if conversion fails. |
Narrow char_type array to char
This virtual function converts each char_type in the range [__lo,__hi) to char using the simplest reasonable transformation and writes the results to the destination array. For any element in the input that cannot be converted, __dfault is used instead.
do_narrow() is a hook for a derived facet to change the behavior of narrowing. do_narrow() must always return the same result for the same input.
Note: this is not what you want for codepage conversions. See codecvt for that.
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
__dfault | Char to use if conversion fails. |
__to | Pointer to the destination array. |
Primary class template ctype facet.
This template class defines classification and conversion functions for character sets. It wraps cctype functionality. Ctype gets used by streams for many I/O operations.
This template provides the protected virtual functions the developer will have to replace in a derived class or specialization to make a working facet. The public functions that access them are defined in __ctype_abstract_base, to allow for implementation flexibility. See ctype<wchar_t> for an example. The functions are documented in __ctype_abstract_base.
Note: implementations are provided for all the protected virtual functions, but will likely not be useful.
The facet id for ctype<char_type>
The ctype<char> specialization.
This class defines classification and conversion functions for the char type. It gets used by char streams for many I/O operations. The char specialization provides a number of optimizations as well.
Typedef for the template parameter char.
The facet id for ctype<char>
The size of the mask table. It is SCHAR_MAX + 1.
Constructor performs initialization.
This is the constructor provided by the standard.
__table | If non-zero, table is used as the per-char mask. Else classic_table() is used. |
__del | If true, passes ownership of table to this facet. |
__refs | Passed to the base facet class. |
Constructor performs static initialization.
This constructor is used to construct the initial C locale facet.
__cloc | Handle to C locale data. |
__table | If non-zero, table is used as the per-char mask. |
__del | If true, passes ownership of table to this facet. |
__refs | Passed to the base facet class. |
Test char classification.
This function compares the mask table[c] to __m.
__c | The char to compare the mask of. |
__m | The mask to compare against. |
Return a mask array.
This function finds the mask for each char in the range [lo, hi) and successively writes it to vec. vec must have as many elements as the char array.
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
__vec | Pointer to an array of mask storage. |
Find char matching a mask
This function searches for and returns the first char in [lo,hi) for which is(m,char) is true.
__m | The mask to compare against. |
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
Find char not matching a mask
This function searches for and returns a pointer to the first char in [__lo,__hi) for which is(m,char) is false.
__m | The mask to compare against. |
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
Convert to uppercase.
This function converts the char argument to uppercase if possible. If not possible (for example, '2'), returns the argument.
toupper() acts as if it returns ctype<char>::do_toupper(c). do_toupper() must always return the same result for the same input.
__c | The char to convert. |
Convert array to uppercase.
This function converts each char in the range [__lo,__hi) to uppercase if possible. Other chars remain untouched.
toupper() acts as if it returns ctype<char>:: do_toupper(__lo, __hi). do_toupper() must always return the same result for the same input.
__lo | Pointer to first char in range. |
__hi | Pointer to end of range. |
Convert to lowercase.
This function converts the char argument to lowercase if possible. If not possible (for example, '2'), returns the argument.
tolower() acts as if it returns ctype<char>::do_tolower(__c). do_tolower() must always return the same result for the same input.
__c | The char to convert. |
Convert array to lowercase.
This function converts each char in the range [lo,hi) to lowercase if possible. Other chars remain untouched.
tolower() acts as if it returns ctype<char>:: do_tolower(__lo, __hi). do_tolower() must always return the same result for the same input.
__lo | Pointer to first char in range. |
__hi | Pointer to end of range. |
Widen char
This function converts the char to char_type using the simplest reasonable transformation. For an underived ctype<char> facet, the argument will be returned unchanged.
This function works as if it returns ctype<char>::do_widen(c). do_widen() must always return the same result for the same input.
Note: this is not what you want for codepage conversions. See codecvt for that.
__c | The char to convert. |
Widen char array
This function converts each char in the input to char using the simplest reasonable transformation. For an underived ctype<char> facet, the argument will be copied unchanged.
This function works as if it returns ctype<char>::do_widen(c). do_widen() must always return the same result for the same input.
Note: this is not what you want for codepage conversions. See codecvt for that.
__lo | Pointer to first char in range. |
__hi | Pointer to end of range. |
__to | Pointer to the destination array. |
Narrow char
This function converts the char to char using the simplest reasonable transformation. If the conversion fails, dfault is returned instead. For an underived ctype<char> facet, c will be returned unchanged.
This function works as if it returns ctype<char>::do_narrow(c). do_narrow() must always return the same result for the same input.
Note: this is not what you want for codepage conversions. See codecvt for that.
__c | The char to convert. |
__dfault | Char to return if conversion fails. |
Narrow char array
This function converts each char in the input to char using the simplest reasonable transformation and writes the results to the destination array. For any char in the input that cannot be converted, dfault is used instead. For an underived ctype<char> facet, the argument will be copied unchanged.
This function works as if it returns ctype<char>::do_narrow(lo, hi, dfault, to). do_narrow() must always return the same result for the same input.
Note: this is not what you want for codepage conversions. See codecvt for that.
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
__dfault | Char to use if conversion fails. |
__to | Pointer to the destination array. |
Returns a pointer to the mask table provided to the constructor, or the default from classic_table() if none was provided.
Returns a pointer to the C locale mask table.
Destructor.
This function deletes table() if del was true in the constructor.
Convert to uppercase.
This virtual function converts the char argument to uppercase if possible. If not possible (for example, '2'), returns the argument.
do_toupper() is a hook for a derived facet to change the behavior of uppercasing. do_toupper() must always return the same result for the same input.
__c | The char to convert. |
Convert array to uppercase.
This virtual function converts each char in the range [lo,hi) to uppercase if possible. Other chars remain untouched.
do_toupper() is a hook for a derived facet to change the behavior of uppercasing. do_toupper() must always return the same result for the same input.
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
Convert to lowercase.
This virtual function converts the char argument to lowercase if possible. If not possible (for example, '2'), returns the argument.
do_tolower() is a hook for a derived facet to change the behavior of lowercasing. do_tolower() must always return the same result for the same input.
__c | The char to convert. |
Convert array to lowercase.
This virtual function converts each char in the range [lo,hi) to lowercase if possible. Other chars remain untouched.
do_tolower() is a hook for a derived facet to change the behavior of lowercasing. do_tolower() must always return the same result for the same input.
__lo | Pointer to first char in range. |
__hi | Pointer to end of range. |
Widen char
This virtual function converts the char to char using the simplest reasonable transformation. For an underived ctype<char> facet, the argument will be returned unchanged.
do_widen() is a hook for a derived facet to change the behavior of widening. do_widen() must always return the same result for the same input.
Note: this is not what you want for codepage conversions. See codecvt for that.
__c | The char to convert. |
Widen char array
This function converts each char in the range [lo,hi) to char using the simplest reasonable transformation. For an underived ctype<char> facet, the argument will be copied unchanged.
do_widen() is a hook for a derived facet to change the behavior of widening. do_widen() must always return the same result for the same input.
Note: this is not what you want for codepage conversions. See codecvt for that.
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
__to | Pointer to the destination array. |
Narrow char
This virtual function converts the char to char using the simplest reasonable transformation. If the conversion fails, dfault is returned instead. For an underived ctype<char> facet, c will be returned unchanged.
do_narrow() is a hook for a derived facet to change the behavior of narrowing. do_narrow() must always return the same result for the same input.
Note: this is not what you want for codepage conversions. See codecvt for that.
__c | The char to convert. |
__dfault | Char to return if conversion fails. |
Narrow char array to char array
This virtual function converts each char in the range [lo,hi) to char using the simplest reasonable transformation and writes the results to the destination array. For any char in the input that cannot be converted, dfault is used instead. For an underived ctype<char> facet, the argument will be copied unchanged.
do_narrow() is a hook for a derived facet to change the behavior of narrowing. do_narrow() must always return the same result for the same input.
Note: this is not what you want for codepage conversions. See codecvt for that.
__lo | Pointer to start of range. |
__hi | Pointer to end of range. |
__dfault | Char to use if conversion fails. |
__to | Pointer to the destination array. |
class ctype_byname [22.2.1.2].
22.2.1.4 Class ctype_byname specializations.
Primary class template numpunct.
This facet stores several pieces of information related to printing and scanning numbers, such as the decimal point character. It takes a template parameter specifying the char type. The numpunct facet is used by streams for many I/O operations involving numbers.
The numpunct template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from a numpunct facet.
Public typedefs
Numpunct facet id.
Numpunct constructor.
__refs | Refcount to pass to the base class. |
Internal constructor. Not for general use.
This is a constructor for use by the library itself to set up the predefined locale facets.
__cache | __numpunct_cache object. |
__refs | Refcount to pass to the base class. |
Internal constructor. Not for general use.
This is a constructor for use by the library itself to set up new locales.
__cloc | The C locale. |
__refs | Refcount to pass to the base class. |
Return decimal point character.
This function returns a char_type to use as a decimal point. It does so by returning returning numpunct<char_type>::do_decimal_point().
Return thousands separator character.
This function returns a char_type to use as a thousands separator. It does so by returning returning numpunct<char_type>::do_thousands_sep().
Return grouping specification.
This function returns a string representing groupings for the integer part of a number. Groupings indicate where thousands separators should be inserted in the integer part of a number.
Each char in the return string is interpret as an integer rather than a character. These numbers represent the number of digits in a group. The first char in the string represents the number of digits in the least significant group. If a char is negative, it indicates an unlimited number of digits for the group. If more chars from the string are required to group a number, the last char is used repeatedly.
For example, if the grouping() returns "\003\002" and is applied to the number 123456789, this corresponds to 12,34,56,789. Note that if the string was "32", this would put more than 50 digits into the least significant group if the character set is ASCII.
The string is returned by calling numpunct<char_type>::do_grouping().
Return string representation of bool true.
This function returns a string_type containing the text representation for true bool variables. It does so by calling numpunct<char_type>::do_truename().
Return string representation of bool false.
This function returns a string_type containing the text representation for false bool variables. It does so by calling numpunct<char_type>::do_falsename().
Destructor.
Return decimal point character.
Returns a char_type to use as a decimal point. This function is a hook for derived classes to change the value returned.
Return thousands separator character.
Returns a char_type to use as a thousands separator. This function is a hook for derived classes to change the value returned.
Return grouping specification.
Returns a string representing groupings for the integer part of a number. This function is a hook for derived classes to change the value returned.
Return string representation of bool true.
Returns a string_type containing the text representation for true bool variables. This function is a hook for derived classes to change the value returned.
Return string representation of bool false.
Returns a string_type containing the text representation for false bool variables. This function is a hook for derived classes to change the value returned.
class numpunct_byname [22.2.3.2].
Primary class template num_get.
This facet encapsulates the code to parse and return a number from a string. It is used by the istream numeric extraction operators.
The num_get template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the num_get facet.
Public typedefs
Numpunct facet id.
Constructor performs initialization.
This is the constructor provided by the standard.
__refs | Passed to the base facet class. |
Numeric parsing.
Parses the input stream into the bool v. It does so by calling num_get::do_get().
If ios_base::boolalpha is set, attempts to read ctype<CharT>::truename() or ctype<CharT>::falsename(). Sets v to true or false if successful. Sets err to ios_base::failbit if reading the string fails. Sets err to ios_base::eofbit if the stream is emptied.
If ios_base::boolalpha is not set, proceeds as with reading a long, except if the value is 1, sets v to true, if the value is 0, sets v to false, and otherwise set err to ios_base::failbit.
__in | Start of input stream. |
__end | End of input stream. |
__io | Source of locale and flags. |
__err | Error flags to set. |
__v | Value to format and insert. |
Numeric parsing.
Parses the input stream into the integral variable v. It does so by calling num_get::do_get().
Parsing is affected by the flag settings in io.
The basic parse is affected by the value of io.flags() & ios_base::basefield. If equal to ios_base::oct, parses like the scanf o specifier. Else if equal to ios_base::hex, parses like X specifier. Else if basefield equal to 0, parses like the i specifier. Otherwise, parses like d for signed and u for unsigned types. The matching type length modifier is also used.
Digit grouping is interpreted according to numpunct::grouping() and numpunct::thousands_sep(). If the pattern of digit groups isn't consistent, sets err to ios_base::failbit.
If parsing the string yields a valid value for v, v is set. Otherwise, sets err to ios_base::failbit and leaves v unaltered. Sets err to ios_base::eofbit if the stream is emptied.
__in | Start of input stream. |
__end | End of input stream. |
__io | Source of locale and flags. |
__err | Error flags to set. |
__v | Value to format and insert. |
Numeric parsing.
Parses the input stream into the integral variable v. It does so by calling num_get::do_get().
The input characters are parsed like the scanf g specifier. The matching type length modifier is also used.
The decimal point character used is numpunct::decimal_point(). Digit grouping is interpreted according to numpunct::grouping() and numpunct::thousands_sep(). If the pattern of digit groups isn't consistent, sets err to ios_base::failbit.
If parsing the string yields a valid value for v, v is set. Otherwise, sets err to ios_base::failbit and leaves v unaltered. Sets err to ios_base::eofbit if the stream is emptied.
__in | Start of input stream. |
__end | End of input stream. |
__io | Source of locale and flags. |
__err | Error flags to set. |
__v | Value to format and insert. |
Numeric parsing.
Parses the input stream into the pointer variable v. It does so by calling num_get::do_get().
The input characters are parsed like the scanf p specifier.
Digit grouping is interpreted according to numpunct::grouping() and numpunct::thousands_sep(). If the pattern of digit groups isn't consistent, sets err to ios_base::failbit.
Note that the digit grouping effect for pointers is a bit ambiguous in the standard and shouldn't be relied on. See DR 344.
If parsing the string yields a valid value for v, v is set. Otherwise, sets err to ios_base::failbit and leaves v unaltered. Sets err to ios_base::eofbit if the stream is emptied.
__in | Start of input stream. |
__end | End of input stream. |
__io | Source of locale and flags. |
__err | Error flags to set. |
__v | Value to format and insert. |
Destructor.
Numeric parsing.
Parses the input stream into the variable v. This function is a hook for derived classes to change the value returned.
__beg | Start of input stream. |
__end | End of input stream. |
__io | Source of locale and flags. |
__err | Error flags to set. |
__v | Value to format and insert. |
Primary class template num_put.
This facet encapsulates the code to convert a number to a string. It is used by the ostream numeric insertion operators.
The num_put template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the num_put facet.
Public typedefs
Numpunct facet id.
Constructor performs initialization.
This is the constructor provided by the standard.
__refs | Passed to the base facet class. |
Numeric formatting.
Formats the boolean v and inserts it into a stream. It does so by calling num_put::do_put().
If ios_base::boolalpha is set, writes ctype<CharT>::truename() or ctype<CharT>::falsename(). Otherwise formats v as an int.
__s | Stream to write to. |
__io | Source of locale and flags. |
__fill | Char_type to use for filling. |
__v | Value to format and insert. |
Numeric formatting.
Formats the integral value v and inserts it into a stream. It does so by calling num_put::do_put().
Formatting is affected by the flag settings in io.
The basic format is affected by the value of io.flags() & ios_base::basefield. If equal to ios_base::oct, formats like the printf o specifier. Else if equal to ios_base::hex, formats like x or X with ios_base::uppercase unset or set respectively. Otherwise, formats like d, ld, lld for signed and u, lu, llu for unsigned values. Note that if both oct and hex are set, neither will take effect.
If ios_base::showpos is set, '+' is output before positive values. If ios_base::showbase is set, '0' precedes octal values (except 0) and '0[xX]' precedes hex values.
The decimal point character used is numpunct::decimal_point(). Thousands separators are inserted according to numpunct::grouping() and numpunct::thousands_sep().
If io.width() is non-zero, enough fill characters are inserted to make the result at least that wide. If (io.flags() & ios_base::adjustfield) == ios_base::left, result is padded at the end. If ios_base::internal, then padding occurs immediately after either a '+' or '-' or after '0x' or '0X'. Otherwise, padding occurs at the beginning.
__s | Stream to write to. |
__io | Source of locale and flags. |
__fill | Char_type to use for filling. |
__v | Value to format and insert. |
Numeric formatting.
Formats the floating point value v and inserts it into a stream. It does so by calling num_put::do_put().
Formatting is affected by the flag settings in io.
The basic format is affected by the value of io.flags() & ios_base::floatfield. If equal to ios_base::fixed, formats like the printf f specifier. Else if equal to ios_base::scientific, formats like e or E with ios_base::uppercase unset or set respectively. Otherwise, formats like g or G depending on uppercase. Note that if both fixed and scientific are set, the effect will also be like g or G.
The output precision is given by io.precision(). This precision is capped at numeric_limits::digits10 + 2 (different for double and long double). The default precision is 6.
If ios_base::showpos is set, '+' is output before positive values. If ios_base::showpoint is set, a decimal point will always be output.
The decimal point character used is numpunct::decimal_point(). Thousands separators are inserted according to numpunct::grouping() and numpunct::thousands_sep().
If io.width() is non-zero, enough fill characters are inserted to make the result at least that wide. If (io.flags() & ios_base::adjustfield) == ios_base::left, result is padded at the end. If ios_base::internal, then padding occurs immediately after either a '+' or '-' or after '0x' or '0X'. Otherwise, padding occurs at the beginning.
__s | Stream to write to. |
__io | Source of locale and flags. |
__fill | Char_type to use for filling. |
__v | Value to format and insert. |
Numeric formatting.
Formats the pointer value v and inserts it into a stream. It does so by calling num_put::do_put().
This function formats v as an unsigned long with ios_base::hex and ios_base::showbase set.
__s | Stream to write to. |
__io | Source of locale and flags. |
__fill | Char_type to use for filling. |
__v | Value to format and insert. |
Destructor.
Numeric formatting.
These functions do the work of formatting numeric values and inserting them into a stream. This function is a hook for derived classes to change the value returned.
__s | Stream to write to. |
__io | Source of locale and flags. |
__fill | Char_type to use for filling. |
__v | Value to format and insert. |
Convenience interface to ctype.is(ctype_base::space, __c).
Convenience interface to ctype.is(ctype_base::print, __c).
Convenience interface to ctype.is(ctype_base::cntrl, __c).
Convenience interface to ctype.is(ctype_base::upper, __c).
Convenience interface to ctype.is(ctype_base::lower, __c).
Convenience interface to ctype.is(ctype_base::alpha, __c).
Convenience interface to ctype.is(ctype_base::digit, __c).
Convenience interface to ctype.is(ctype_base::punct, __c).
Convenience interface to ctype.is(ctype_base::xdigit, __c).
Convenience interface to ctype.is(ctype_base::alnum, __c).
Convenience interface to ctype.is(ctype_base::graph, __c).
Convenience interface to ctype.toupper(__c).
Convenience interface to ctype.tolower(__c).
Time format ordering data.
This class provides an enum representing different orderings of time: day, month, and year.
Numpunct facet id.
Internal constructor. Not for general use.
This is a constructor for use by the library itself to set up new locales.
__cloc | The C locale. |
__s | The name of a locale. |
refs | Passed to the base facet class. |
Primary class template time_get.
This facet encapsulates the code to parse and return a date or time from a string. It is used by the istream numeric extraction operators.
The time_get template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the time_get facet.
Public typedefs
Numpunct facet id.
Constructor performs initialization.
This is the constructor provided by the standard.
__refs | Passed to the base facet class. |
Return preferred order of month, day, and year.
This function returns an enum from time_base::dateorder giving the preferred ordering if the format x given to time_put::put() only uses month, day, and year. If the format x for the associated locale uses other fields, this function returns time_base::dateorder::noorder.
NOTE: The library always returns noorder at the moment.
Parse input time string.
This function parses a time according to the format X and puts the results into a user-supplied struct tm. The result is returned by calling time_get::do_get_time().
If there is a valid time string according to format X, tm will be filled in accordingly and the returned iterator will point to the first character beyond the time string. If an error occurs before the end, err |= ios_base::failbit. If parsing reads all the characters, err |= ios_base::eofbit.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Parse input date string.
This function parses a date according to the format x and puts the results into a user-supplied struct tm. The result is returned by calling time_get::do_get_date().
If there is a valid date string according to format x, tm will be filled in accordingly and the returned iterator will point to the first character beyond the date string. If an error occurs before the end, err |= ios_base::failbit. If parsing reads all the characters, err |= ios_base::eofbit.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Parse input weekday string.
This function parses a weekday name and puts the results into a user-supplied struct tm. The result is returned by calling time_get::do_get_weekday().
Parsing starts by parsing an abbreviated weekday name. If a valid abbreviation is followed by a character that would lead to the full weekday name, parsing continues until the full name is found or an error occurs. Otherwise parsing finishes at the end of the abbreviated name.
If an error occurs before the end, err |= ios_base::failbit. If parsing reads all the characters, err |= ios_base::eofbit.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Parse input month string.
This function parses a month name and puts the results into a user-supplied struct tm. The result is returned by calling time_get::do_get_monthname().
Parsing starts by parsing an abbreviated month name. If a valid abbreviation is followed by a character that would lead to the full month name, parsing continues until the full name is found or an error occurs. Otherwise parsing finishes at the end of the abbreviated name.
If an error occurs before the end, err |= ios_base::failbit. If parsing reads all the characters, err |= ios_base::eofbit.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Parse input year string.
This function reads up to 4 characters to parse a year string and puts the results into a user-supplied struct tm. The result is returned by calling time_get::do_get_year().
4 consecutive digits are interpreted as a full year. If there are exactly 2 consecutive digits, the library interprets this as the number of years since 1900.
If an error occurs before the end, err |= ios_base::failbit. If parsing reads all the characters, err |= ios_base::eofbit.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Destructor.
Return preferred order of month, day, and year.
This function returns an enum from time_base::dateorder giving the preferred ordering if the format x given to time_put::put() only uses month, day, and year. This function is a hook for derived classes to change the value returned.
Parse input time string.
This function parses a time according to the format x and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Parse input date string.
This function parses a date according to the format X and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Parse input weekday string.
This function parses a weekday name and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Parse input month string.
This function parses a month name and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
Parse input year string.
This function reads up to 4 characters to parse a year string and puts the results into a user-supplied struct tm. This function is a hook for derived classes to change the value returned.
__beg | Start of string to parse. |
__end | End of string to parse. |
__io | Source of the locale. |
__err | Error flags to set. |
__tm | Pointer to struct tm to fill in. |
class time_get_byname [22.2.5.2].
Primary class template time_put.
This facet encapsulates the code to format and output dates and times according to formats used by strftime().
The time_put template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the time_put facet.
Public typedefs
Numpunct facet id.
Constructor performs initialization.
This is the constructor provided by the standard.
__refs | Passed to the base facet class. |
Format and output a time or date.
This function formats the data in struct tm according to the provided format string. The format string is interpreted as by strftime().
__s | The stream to write to. |
__io | Source of locale. |
__fill | char_type to use for padding. |
__tm | Struct tm with date and time info to format. |
__beg | Start of format string. |
__end | End of format string. |
Format and output a time or date.
This function formats the data in struct tm according to the provided format char and optional modifier. The format and modifier are interpreted as by strftime(). It does so by returning time_put::do_put().
__s | The stream to write to. |
__io | Source of locale. |
__fill | char_type to use for padding. |
__tm | Struct tm with date and time info to format. |
__format | Format char. |
__mod | Optional modifier char. |
Destructor.
Format and output a time or date.
This function formats the data in struct tm according to the provided format char and optional modifier. This function is a hook for derived classes to change the value returned.
__s | The stream to write to. |
__io | Source of locale. |
__fill | char_type to use for padding. |
__tm | Struct tm with date and time info to format. |
__format | Format char. |
__mod | Optional modifier char. |
class time_put_byname [22.2.5.4].
Money format ordering data.
This class contains an ordered array of 4 fields to represent the pattern for formatting a money amount. Each field may contain one entry from the part enum. symbol, sign, and value must be present and the remaining field must contain either none or space.
Primary class template moneypunct.
This facet encapsulates the punctuation, grouping and other formatting features of money amount string representations.
Public typedefs
This value is provided by the standard, but no reason for its existence.
Numpunct facet id.
Constructor performs initialization.
This is the constructor provided by the standard.
__refs | Passed to the base facet class. |
Constructor performs initialization.
This is an internal constructor.
__cache | Cache for optimization. |
__refs | Passed to the base facet class. |
Internal constructor. Not for general use.
This is a constructor for use by the library itself to set up new locales.
__cloc | The C locale. |
__s | The name of a locale. |
__refs | Passed to the base facet class. |
Return decimal point character.
This function returns a char_type to use as a decimal point. It does so by returning returning moneypunct<char_type>::do_decimal_point().
Return thousands separator character.
This function returns a char_type to use as a thousands separator. It does so by returning returning moneypunct<char_type>::do_thousands_sep().
Return grouping specification.
This function returns a string representing groupings for the integer part of an amount. Groupings indicate where thousands separators should be inserted.
Each char in the return string is interpret as an integer rather than a character. These numbers represent the number of digits in a group. The first char in the string represents the number of digits in the least significant group. If a char is negative, it indicates an unlimited number of digits for the group. If more chars from the string are required to group a number, the last char is used repeatedly.
For example, if the grouping() returns \003\002
and is applied to the number 123456789, this corresponds to 12,34,56,789. Note that if the string was 32
, this would put more than 50 digits into the least significant group if the character set is ASCII.
The string is returned by calling moneypunct<char_type>::do_grouping().
Return currency symbol string.
This function returns a string_type to use as a currency symbol. It does so by returning returning moneypunct<char_type>::do_curr_symbol().
Return positive sign string.
This function returns a string_type to use as a sign for positive amounts. It does so by returning returning moneypunct<char_type>::do_positive_sign().
If the return value contains more than one character, the first character appears in the position indicated by pos_format() and the remainder appear at the end of the formatted string.
Return negative sign string.
This function returns a string_type to use as a sign for negative amounts. It does so by returning returning moneypunct<char_type>::do_negative_sign().
If the return value contains more than one character, the first character appears in the position indicated by neg_format() and the remainder appear at the end of the formatted string.
Return number of digits in fraction.
This function returns the exact number of digits that make up the fractional part of a money amount. It does so by returning returning moneypunct<char_type>::do_frac_digits().
The fractional part of a money amount is optional. But if it is present, there must be frac_digits() digits.
Return pattern for money values.
This function returns a pattern describing the formatting of a positive or negative valued money amount. It does so by returning returning moneypunct<char_type>::do_pos_format() or moneypunct<char_type>::do_neg_format().
The pattern has 4 fields describing the ordering of symbol, sign, value, and none or space. There must be one of each in the pattern. The none and space enums may not appear in the first field and space may not appear in the final field.
The parts of a money string must appear in the order indicated by the fields of the pattern. The symbol field indicates that the value of curr_symbol() may be present. The sign field indicates that the value of positive_sign() or negative_sign() must be present. The value field indicates that the absolute value of the money amount is present. none indicates 0 or more whitespace characters, except at the end, where it permits no whitespace. space indicates that 1 or more whitespace characters must be present.
For example, for the US locale and pos_format() pattern {symbol,sign,value,none}, curr_symbol() == '$' positive_sign() == '+', and value 10.01, and options set to force the symbol, the corresponding string is $+10.01
.
Destructor.
Return decimal point character.
Returns a char_type to use as a decimal point. This function is a hook for derived classes to change the value returned.
Return thousands separator character.
Returns a char_type to use as a thousands separator. This function is a hook for derived classes to change the value returned.
Return grouping specification.
Returns a string representing groupings for the integer part of a number. This function is a hook for derived classes to change the value returned.
Return currency symbol string.
This function returns a string_type to use as a currency symbol. This function is a hook for derived classes to change the value returned.
Return positive sign string.
This function returns a string_type to use as a sign for positive amounts. This function is a hook for derived classes to change the value returned.
Return negative sign string.
This function returns a string_type to use as a sign for negative amounts. This function is a hook for derived classes to change the value returned.
Return number of digits in fraction.
This function returns the exact number of digits that make up the fractional part of a money amount. This function is a hook for derived classes to change the value returned.
Return pattern for money values.
This function returns a pattern describing the formatting of a positive valued money amount. This function is a hook for derived classes to change the value returned.
Return pattern for money values.
This function returns a pattern describing the formatting of a negative valued money amount. This function is a hook for derived classes to change the value returned.
class moneypunct_byname [22.2.6.4].
Primary class template money_get.
This facet encapsulates the code to parse and return a monetary amount from a string.
The money_get template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the money_get facet.
Public typedefs
Numpunct facet id.
Constructor performs initialization.
This is the constructor provided by the standard.
__refs | Passed to the base facet class. |
Read and parse a monetary value.
This function reads characters from __s, interprets them as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and returns the result in units as an integral value moneypunct::frac_digits() * the actual amount. For example, the string $10.01 in a US locale would store 1001 in units.
Any characters not part of a valid money amount are not consumed.
If a money value cannot be parsed from the input stream, sets err=(err|io.failbit). If the stream is consumed before finishing parsing, sets err=(err|io.failbit|io.eofbit). units is unchanged if parsing fails.
This function works by returning the result of do_get().
__s | Start of characters to parse. |
__end | End of characters to parse. |
__intl | Parameter to use_facet<moneypunct<CharT,intl> >. |
__io | Source of facets and io state. |
__err | Error field to set if parsing fails. |
__units | Place to store result of parsing. |
Read and parse a monetary value.
This function reads characters from __s, interprets them as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and returns the result in digits. For example, the string $10.01 in a US locale would store 1001
in digits.
Any characters not part of a valid money amount are not consumed.
If a money value cannot be parsed from the input stream, sets err=(err|io.failbit). If the stream is consumed before finishing parsing, sets err=(err|io.failbit|io.eofbit).
This function works by returning the result of do_get().
__s | Start of characters to parse. |
__end | End of characters to parse. |
__intl | Parameter to use_facet<moneypunct<CharT,intl> >. |
__io | Source of facets and io state. |
__err | Error field to set if parsing fails. |
__digits | Place to store result of parsing. |
Destructor.
Read and parse a monetary value.
This function reads and parses characters representing a monetary value. This function is a hook for derived classes to change the value returned.
Read and parse a monetary value.
This function reads and parses characters representing a monetary value. This function is a hook for derived classes to change the value returned.
Primary class template money_put.
This facet encapsulates the code to format and output a monetary amount.
The money_put template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the money_put facet.
Public typedefs
Numpunct facet id.
Constructor performs initialization.
This is the constructor provided by the standard.
__refs | Passed to the base facet class. |
Format and output a monetary value.
This function formats units as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and writes the resulting characters to __s. For example, the value 1001 in a US locale would write $10.01
to __s.
This function works by returning the result of do_put().
__s | The stream to write to. |
__intl | Parameter to use_facet<moneypunct<CharT,intl> >. |
__io | Source of facets and io state. |
__fill | char_type to use for padding. |
__units | Place to store result of parsing. |
Format and output a monetary value.
This function formats digits as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and writes the resulting characters to __s. For example, the string 1001
in a US locale would write $10.01
to __s.
This function works by returning the result of do_put().
__s | The stream to write to. |
__intl | Parameter to use_facet<moneypunct<CharT,intl> >. |
__io | Source of facets and io state. |
__fill | char_type to use for padding. |
__digits | Place to store result of parsing. |
Destructor.
Format and output a monetary value.
This function formats units as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and writes the resulting characters to __s. For example, the value 1001 in a US locale would write $10.01
to __s.
This function is a hook for derived classes to change the value returned.
__s | The stream to write to. |
__intl | Parameter to use_facet<moneypunct<CharT,intl> >. |
__io | Source of facets and io state. |
__fill | char_type to use for padding. |
__units | Place to store result of parsing. |
Format and output a monetary value.
This function formats digits as a monetary value according to moneypunct and ctype facets retrieved from io.getloc(), and writes the resulting characters to __s. For example, the string 1001
in a US locale would write $10.01
to __s.
This function is a hook for derived classes to change the value returned.
__s | The stream to write to. |
__intl | Parameter to use_facet<moneypunct<CharT,intl> >. |
__io | Source of facets and io state. |
__fill | char_type to use for padding. |
__digits | Place to store result of parsing. |
Messages facet base class providing catalog typedef.
Primary class template messages.
This facet encapsulates the code to retrieve messages from message catalogs. The only thing defined by the standard for this facet is the interface. All underlying functionality is implementation-defined.
This library currently implements 3 versions of the message facet. The first version (gnu) is a wrapper around gettext, provided by libintl. The second version (ieee) is a wrapper around catgets. The final version (default) does no actual translation. These implementations are only provided for char and wchar_t instantiations.
The messages template uses protected virtual functions to provide the actual results. The public accessors forward the call to the virtual functions. These virtual functions are hooks for developers to implement the behavior they require from the messages facet.
Public typedefs
Numpunct facet id.
Constructor performs initialization.
This is the constructor provided by the standard.
__refs | Passed to the base facet class. |
Internal constructor. Not for general use.
This is a constructor for use by the library itself to set up new locales.
__cloc | The C locale. |
__s | The name of a locale. |
__refs | Refcount to pass to the base class. |
Destructor.
Specializations for required instantiations.
class messages_byname [22.2.7.2].