BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR > Class Template Reference

#include <bdldfp_decimal.h>

Inheritance diagram for bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >:

Public Types

typedef CHARTYPE char_type
 
typedef OUTPUTITERATOR iter_type
 

Public Member Functions

 DecimalNumPut (bsl::size_t refs=0)
 
iter_type put (iter_type out, bsl::ios_base &str, char_type fill, Decimal32 value) const
 
iter_type put (iter_type out, bsl::ios_base &str, char_type fill, Decimal64 value) const
 
iter_type put (iter_type out, bsl::ios_base &str, char_type fill, Decimal128 value) const
 

Static Public Member Functions

static const DecimalNumPut< CHARTYPE, OUTPUTITERATOR > & object ()
 

Static Public Attributes

static bsl::locale::id id
 

Protected Member Functions

 ~DecimalNumPut () BSLS_KEYWORD_OVERRIDE
 Destroy this object. Note that the destructor is virtual.
 
virtual iter_type do_put (iter_type out, bsl::ios_base &ios_format, char_type fill, Decimal32 value) const
 
virtual iter_type do_put (iter_type out, bsl::ios_base &ios_format, char_type fill, Decimal64 value) const
 
virtual iter_type do_put (iter_type out, bsl::ios_base &ios_format, char_type fill, Decimal128 value) const
 
template<class DECIMAL >
iter_type do_put_impl (iter_type out, bsl::ios_base &ios_format, char_type fill, DECIMAL value) const
 

Detailed Description

template<class CHARTYPE, class OUTPUTITERATOR = bsl::ostreambuf_iterator<CHARTYPE>>
class bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >

A facet type (mechanism) used in writing decimal floating-point types. Note that this type does not follow BDE conventions because its content is dictated by the C++ standard and native standard library implementations. See ISO/IEC TR 24733 3.10.3 for details.

See bdldfp_decimal

Member Typedef Documentation

◆ char_type

template<class CHARTYPE , class OUTPUTITERATOR = bsl::ostreambuf_iterator<CHARTYPE>>
typedef CHARTYPE bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >::char_type

◆ iter_type

template<class CHARTYPE , class OUTPUTITERATOR = bsl::ostreambuf_iterator<CHARTYPE>>
typedef OUTPUTITERATOR bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >::iter_type

Constructor & Destructor Documentation

◆ DecimalNumPut()

template<class CHARTYPE , class OUTPUTITERATOR = bsl::ostreambuf_iterator<CHARTYPE>>
bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >::DecimalNumPut ( bsl::size_t  refs = 0)
explicit

Constructs a DecimalNumPut object. Optionally specify starting reference count refs, which will default to 0. If refs is non-zero, the DecimalNumPut object will not be deleted when the last locale referencing it goes out of scope.

◆ ~DecimalNumPut()

template<class CHARTYPE , class OUTPUTITERATOR = bsl::ostreambuf_iterator<CHARTYPE>>
bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >::~DecimalNumPut ( )
protected

Member Function Documentation

◆ do_put() [1/3]

template<class CHARTYPE , class OUTPUTITERATOR = bsl::ostreambuf_iterator<CHARTYPE>>
virtual iter_type bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >::do_put ( iter_type  out,
bsl::ios_base &  ios_format,
char_type  fill,
Decimal128  value 
) const
protectedvirtual

◆ do_put() [2/3]

template<class CHARTYPE , class OUTPUTITERATOR = bsl::ostreambuf_iterator<CHARTYPE>>
virtual iter_type bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >::do_put ( iter_type  out,
bsl::ios_base &  ios_format,
char_type  fill,
Decimal32  value 
) const
protectedvirtual

Write characters (of char_type ) that represent the specified value to the output stream determined by the specified out output iterator. Use the bsl::ctype and the bsl::numpunct facets imbued to the specified stream-base ios_format as well as the formatting flags of the ios_format (bsl.flags()) to generate the properly localized output. The specified fill character will be used as a placeholder character in padded output. For further, more detailed information please consult the section [lib.facet.num.put.virtuals] of the C++ Standard noting that the length modifiers "H", "D" and "DD" are added to the conversion specifiers of for the types Decimal32, 64 and 128, respectively. Also note that these (possibly overridden) do_put virtual function are used by every formatted C++ stream output operator call (out << aDecNumber). Note that currently, only the width, capitalization, justification, fixed and scientific formatting flags are supported, and the operators only support code pages that include the ASCII sub-range. Because of potential future improvements to support additional formatting flags, the operations should not be used for serialization.

◆ do_put() [3/3]

template<class CHARTYPE , class OUTPUTITERATOR = bsl::ostreambuf_iterator<CHARTYPE>>
virtual iter_type bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >::do_put ( iter_type  out,
bsl::ios_base &  ios_format,
char_type  fill,
Decimal64  value 
) const
protectedvirtual

◆ do_put_impl()

template<class CHARTYPE , class OUTPUTITERATOR = bsl::ostreambuf_iterator<CHARTYPE>>
template<class DECIMAL >
iter_type bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >::do_put_impl ( iter_type  out,
bsl::ios_base &  ios_format,
char_type  fill,
DECIMAL  value 
) const
protected

Write characters that represent the specified value into a string of the specified char_type , and output the represented decimal number to the specified out, adjusting for the formatting flags in the specified ios_format and using the specified fill character. Currently, formatting for the formatting flags of justification, width, uppercase, showpos, fixed and scientific are supported.

◆ object()

template<class CHARTYPE , class OUTPUTITERATOR = bsl::ostreambuf_iterator<CHARTYPE>>
static const DecimalNumPut< CHARTYPE, OUTPUTITERATOR > & bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >::object ( )
static

◆ put() [1/3]

template<class CHARTYPE , class OUTPUTITERATOR = bsl::ostreambuf_iterator<CHARTYPE>>
iter_type bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >::put ( iter_type  out,
bsl::ios_base &  str,
char_type  fill,
Decimal128  value 
) const

◆ put() [2/3]

template<class CHARTYPE , class OUTPUTITERATOR = bsl::ostreambuf_iterator<CHARTYPE>>
iter_type bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >::put ( iter_type  out,
bsl::ios_base &  str,
char_type  fill,
Decimal32  value 
) const

Forward to, and return using the specified out, str, fill, and value, the results of this->do_put(out, str, fill, value).

◆ put() [3/3]

template<class CHARTYPE , class OUTPUTITERATOR = bsl::ostreambuf_iterator<CHARTYPE>>
iter_type bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >::put ( iter_type  out,
bsl::ios_base &  str,
char_type  fill,
Decimal64  value 
) const

Member Data Documentation

◆ id

template<class CHARTYPE , class OUTPUTITERATOR = bsl::ostreambuf_iterator<CHARTYPE>>
bsl::locale::id bdldfp::DecimalNumPut< CHARTYPE, OUTPUTITERATOR >::id
static

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