STD::MONEY_GET(3cxx)

🌸 NAME 🌸

Okay bestie, meet std::money_get< _CharT, _InIter > β€” the manual name is std::money_get< _CharT, _InIter >(3cxx). It’s the Primary class template money_get. Periodt. πŸ’…

✨ SYNOPSIS ✨

#include <locale>

Inherits std::locale::facet.

πŸŽ€ Public Types πŸŽ€

  • typedef _CharT char_type β€” Public typedefs.
  • typedef _InIter iter_type β€” Public typedefs.
  • typedef basic_string< _CharT > string_type β€” Public typedefs.

🌈 Public Member Functions 🌈

  • money_get (size_t __refs=0) β€” Constructor performs initialization.
  • template<bool _Intl> _GLIBCXX_BEGIN_NAMESPACE_LDBL_OR_CXX11 _InIter _M_extract (iter_type __beg, iter_type __end, ios_base &__io, ios_base::iostate &__err, string &__units) const β€” public member signature, exactly as listed; no extra description in the original.
  • iter_type get (iter_type __s, iter_type __end, bool __intl, ios_base &__io, ios_base::iostate &__err, long double &__units) const β€” Read and parse a monetary value.
  • iter_type get (iter_type __s, iter_type __end, bool __intl, ios_base &__io, ios_base::iostate &__err, string_type &__digits) const β€” Read and parse a monetary value.

πŸ¦‹ Static Public Attributes πŸ¦‹

  • static locale::id id β€” Numpunct facet id.

πŸ’œ Protected Member Functions πŸ’œ

  • virtual ~money_get () β€” Destructor.
  • template<bool _Intl> iter_type _M_extract (iter_type __s, iter_type __end, ios_base &__io, ios_base::iostate &__err, string &__digits) const β€” no extra description in the original.
  • virtual iter_type do_get (iter_type __s, iter_type __end, bool __intl, ios_base &__io, ios_base::iostate &__err, long double &__units) const β€” Read and parse a monetary value.
  • virtual iter_type do_get (iter_type __s, iter_type __end, bool __intl, ios_base &__io, ios_base::iostate &__err, string_type &__digits) const β€” Read and parse a monetary value.

🧚 Static Protected Member Functions 🧚

  • static __c_locale _S_clone_c_locale (__c_locale &__cloc) throw ()
  • static void _S_create_c_locale (__c_locale &__cloc, const char *__s, __c_locale __old=0)
  • static void _S_destroy_c_locale (__c_locale &__cloc)
  • static __c_locale _S_get_c_locale ()
  • static const char * _S_get_c_name () throw ()
  • static __c_locale _S_lc_ctype_c_locale (__c_locale __cloc, const char *__s)

πŸ¦‹ Detailed Description πŸ¦‹

template<typename _CharT, typename _InIter>
class std::money_get< _CharT, _InIter >

The source labels this: Primary class template money_get. Also, there’s a chaotic little stray " right after that signature before β€œPrimary class template money_get.” in the original β€” honoring it, bestie. πŸ™ˆ

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.

🧸 Member Typedef Documentation 🧸

  • template<typename _CharT , typename _InIter > typedef _CharT std::money_get< _CharT, _InIter >::char_type β€” Public typedefs.
  • template<typename _CharT , typename _InIter > typedef _InIter std::money_get< _CharT, _InIter >::iter_type β€” Public typedefs.
  • template<typename _CharT , typename _InIter > typedef basic_string<_CharT> std::money_get< _CharT, _InIter >::string_type β€” Public typedefs.

πŸŽ€ Constructor & Destructor Documentation πŸŽ€

  • template<typename _CharT , typename _InIter > std::money_get< _CharT, _InIter >::money_get (size_t __refs = 0) [inline], [explicit] β€” Constructor performs initialization. This is the constructor provided by the standard.
    • Parameters: __refs β€” Passed to the base facet class.
  • template<typename _CharT , typename _InIter > virtual std::money_get< _CharT, _InIter >::~money_get () [inline], [protected], [virtual] β€” Destructor.

πŸ“ Member Function Documentation πŸ“

πŸ’– do_get β€” long double version πŸ’–

template<typename _CharT , typename _InIter > _InIter std::money_get< _CharT, _InIter >::do_get (iter_type __s, iter_type __end, bool __intl, ios_base & __io, ios_base::iostate & __err, long double & __units) const [protected],  [virtual]

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.

See also get() for details.

References: std::basic_string< _CharT, _Traits, _Alloc >::c_str().

Referenced by: std::money_get< _CharT, _InIter >::get(), and std::money_get< _CharT, _InIter >::get().

🌸 do_get β€” string_type version 🌸

template<typename _CharT , typename _InIter > _InIter std::money_get< _CharT, _InIter >::do_get (iter_type __s, iter_type __end, bool __intl, ios_base & __io, ios_base::iostate & __err, string_type & __digits) const [protected],  [virtual]

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.

See also get() for details.

References: std::ios_base::_M_getloc(), std::basic_string< _CharT, _Traits, _Alloc >::resize(), and std::__ctype_abstract_base< _CharT >::widen().

πŸ”₯ get β€” long double version πŸ”₯

template<typename _CharT , typename _InIter > iter_type std::money_get< _CharT, _InIter >::get (iter_type __s, iter_type __end, bool __intl, ios_base & __io, ios_base::iostate & __err, long double & __units) const [inline]

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().

  • Parameters:
    • __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.
  • Returns: Iterator referencing first character beyond valid money amount.

References: std::money_get< _CharT, _InIter >::do_get().

🌈 get β€” string_type version 🌈

template<typename _CharT , typename _InIter > iter_type std::money_get< _CharT, _InIter >::get (iter_type __s, iter_type __end, bool __intl, ios_base & __io, ios_base::iostate & __err, string_type & __digits) const [inline]

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().

  • Parameters:
    • __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.
  • Returns: Iterator referencing first character beyond valid money amount.

References: std::money_get< _CharT, _InIter >::do_get().

πŸ‘‘ Member Data Documentation πŸ‘‘

  • template<typename _CharT , typename _InIter > locale::id std::money_get< _CharT, _InIter >::id [static] β€” Numpunct facet id.

πŸ’œ Author πŸ’œ

Generated automatically by Doxygen for libstdc++ from the source code.


Source/version flex: libstdc++, auto-generated by Doxygen from the source code. The footer says libststd::money_get< _CharT, _InIter >(3cxx), and there’s no date shown on the page, bestie. πŸ«ΆπŸ’œβœ¨

πŸ“¦ where this page comes from