libstdc++
std::num_get Class Reference
Inheritance diagram for std::num_get:

List of all members.

Public Types

Public Member Functions

Static Public Attributes

Protected Member Functions

Static Protected Member Functions

Friends


Detailed Description

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.


Member Typedef Documentation

typedef _CharT std::num_get::char_type

Public typedefs.

Definition at line 1922 of file locale_facets.h.

typedef _InIter std::num_get::iter_type

Public typedefs.

Definition at line 1923 of file locale_facets.h.


Constructor & Destructor Documentation

std::num_get::num_get ( size_t  __refs = 0) [inline, explicit]

Constructor performs initialization.

This is the constructor provided by the standard.

Parameters:
refsPassed to the base facet class.

Definition at line 1937 of file locale_facets.h.

virtual std::num_get::~num_get ( ) [inline, protected, virtual]

Destructor.

Definition at line 2106 of file locale_facets.h.


Member Function Documentation

_InIter std::num_get::do_get ( iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
bool &  __v 
) const [protected, virtual]

Numeric parsing.

Parses the input stream into the variable v. This function is a hook for derived classes to change the value returned.

See also:
get() for more details.
Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 592 of file locale_facets.tcc.

References std::ios_base::flags(), std::boolalpha(), and std::ios_base::_M_getloc().

virtual iter_type std::num_get::do_get ( iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
long &  __v 
) const [inline, protected, virtual]

Numeric parsing.

Parses the input stream into the variable v. This function is a hook for derived classes to change the value returned.

See also:
get() for more details.
Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2174 of file locale_facets.h.

virtual iter_type std::num_get::do_get ( iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
unsigned short &  __v 
) const [inline, protected, virtual]

Numeric parsing.

Parses the input stream into the variable v. This function is a hook for derived classes to change the value returned.

See also:
get() for more details.
Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2179 of file locale_facets.h.

virtual iter_type std::num_get::do_get ( iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
unsigned int &  __v 
) const [inline, protected, virtual]

Numeric parsing.

Parses the input stream into the variable v. This function is a hook for derived classes to change the value returned.

See also:
get() for more details.
Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2184 of file locale_facets.h.

virtual iter_type std::num_get::do_get ( iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
unsigned long &  __v 
) const [inline, protected, virtual]

Numeric parsing.

Parses the input stream into the variable v. This function is a hook for derived classes to change the value returned.

See also:
get() for more details.
Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2189 of file locale_facets.h.

virtual iter_type std::num_get::do_get ( iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
long long &  __v 
) const [inline, protected, virtual]

Numeric parsing.

Parses the input stream into the variable v. This function is a hook for derived classes to change the value returned.

See also:
get() for more details.
Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2195 of file locale_facets.h.

virtual iter_type std::num_get::do_get ( iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
unsigned long long &  __v 
) const [inline, protected, virtual]

Numeric parsing.

Parses the input stream into the variable v. This function is a hook for derived classes to change the value returned.

See also:
get() for more details.
Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2200 of file locale_facets.h.

_InIter std::num_get::do_get ( iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
float &  __v 
) const [protected, virtual]

Numeric parsing.

Parses the input stream into the variable v. This function is a hook for derived classes to change the value returned.

See also:
get() for more details.
Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 688 of file locale_facets.tcc.

References std::basic_string::reserve(), and std::basic_string::c_str().

_InIter std::num_get::do_get ( iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
double &  __v 
) const [protected, virtual]

Numeric parsing.

Parses the input stream into the variable v. This function is a hook for derived classes to change the value returned.

See also:
get() for more details.
Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 703 of file locale_facets.tcc.

References std::basic_string::reserve(), and std::basic_string::c_str().

_InIter std::num_get::do_get ( iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
long double &  __v 
) const [protected, virtual]

Numeric parsing.

Parses the input stream into the variable v. This function is a hook for derived classes to change the value returned.

See also:
get() for more details.
Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 735 of file locale_facets.tcc.

References std::basic_string::reserve(), and std::basic_string::c_str().

_InIter std::num_get::do_get ( iter_type  __beg,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
void *&  __v 
) const [protected, virtual]

Numeric parsing.

Parses the input stream into the variable v. This function is a hook for derived classes to change the value returned.

See also:
get() for more details.
Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 750 of file locale_facets.tcc.

References std::ios_base::flags(), std::ios_base::basefield, and std::ios_base::hex.

iter_type std::num_get::get ( iter_type  __in,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
bool &  __v 
) const [inline]

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.

Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 1963 of file locale_facets.h.

Referenced by std::basic_istream::operator>>().

iter_type std::num_get::get ( iter_type  __in,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
long &  __v 
) const [inline]

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.

Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 1999 of file locale_facets.h.

iter_type std::num_get::get ( iter_type  __in,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
unsigned short &  __v 
) const [inline]

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.

Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2004 of file locale_facets.h.

iter_type std::num_get::get ( iter_type  __in,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
unsigned int &  __v 
) const [inline]

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.

Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2009 of file locale_facets.h.

iter_type std::num_get::get ( iter_type  __in,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
unsigned long &  __v 
) const [inline]

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.

Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2014 of file locale_facets.h.

iter_type std::num_get::get ( iter_type  __in,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
long long &  __v 
) const [inline]

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.

Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2020 of file locale_facets.h.

iter_type std::num_get::get ( iter_type  __in,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
unsigned long long &  __v 
) const [inline]

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.

Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2025 of file locale_facets.h.

iter_type std::num_get::get ( iter_type  __in,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
float &  __v 
) const [inline]

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.

Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2058 of file locale_facets.h.

iter_type std::num_get::get ( iter_type  __in,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
double &  __v 
) const [inline]

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.

Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2063 of file locale_facets.h.

iter_type std::num_get::get ( iter_type  __in,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
long double &  __v 
) const [inline]

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.

Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2068 of file locale_facets.h.

iter_type std::num_get::get ( iter_type  __in,
iter_type  __end,
ios_base __io,
ios_base::iostate __err,
void *&  __v 
) const [inline]

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.

Parameters:
inStart of input stream.
endEnd of input stream.
ioSource of locale and flags.
errError flags to set.
vValue to format and insert.
Returns:
Iterator after reading.

Definition at line 2100 of file locale_facets.h.


Member Data Documentation

Numpunct facet id.

Definition at line 1927 of file locale_facets.h.


The documentation for this class was generated from the following files: