Quick Links:

bal | bbl | bdl | bsl

Classes | Public Types | Static Public Member Functions

bslalg::NumericFormatterUtil Struct Reference

#include <bslalg_numericformatterutil.h>

List of all members.

Classes

struct  FltMaxLen
struct  IntMaxLen< false, 1, BASE >
struct  IntMaxLen< false, 2, BASE >
struct  IntMaxLen< false, 4, BASE >
struct  IntMaxLen< false, 8, BASE >
struct  IntMaxLen< true, 1, BASE >
struct  IntMaxLen< true, 2, BASE >
struct  IntMaxLen< true, 4, BASE >
struct  IntMaxLen< true, 8, BASE >
struct  IsSupportedFloatingPoint
struct  IsSupportedIntegral
struct  ToCharsMaxLength

Public Types

enum  Format { e_SCIENTIFIC = 0x40, e_FIXED = 0x80 }

Static Public Member Functions

static char * toChars (char *first, char *last, char value, int base=10) BSLS_KEYWORD_NOEXCEPT
static char * toChars (char *first, char *last, signed char value, int base=10) BSLS_KEYWORD_NOEXCEPT
static char * toChars (char *first, char *last, unsigned char value, int base=10) BSLS_KEYWORD_NOEXCEPT
static char * toChars (char *first, char *last, signed short int value, int base=10) BSLS_KEYWORD_NOEXCEPT
static char * toChars (char *first, char *last, unsigned short int value, int base=10) BSLS_KEYWORD_NOEXCEPT
static char * toChars (char *first, char *last, signed int value, int base=10) BSLS_KEYWORD_NOEXCEPT
static char * toChars (char *first, char *last, unsigned int value, int base=10) BSLS_KEYWORD_NOEXCEPT
static char * toChars (char *first, char *last, signed long int value, int base=10) BSLS_KEYWORD_NOEXCEPT
static char * toChars (char *first, char *last, unsigned long int value, int base=10) BSLS_KEYWORD_NOEXCEPT
static char * toChars (char *first, char *last, signed long long int value, int base=10) BSLS_KEYWORD_NOEXCEPT
static char * toChars (char *first, char *last, unsigned long long int value, int base=10) BSLS_KEYWORD_NOEXCEPT
static char * toChars (char *first, char *last, double value) BSLS_KEYWORD_NOEXCEPT
static char * toChars (char *first, char *last, float value) BSLS_KEYWORD_NOEXCEPT
static char * toChars (char *first, char *last, double value, Format format) BSLS_KEYWORD_NOEXCEPT
static char * toChars (char *first, char *last, float value, Format format) BSLS_KEYWORD_NOEXCEPT

Detailed Description

Namespace struct for free functions supporting to_chars.

See Component bslalg_numericformatterutil


Member Enumeration Documentation

This enumeration lists the supported, explicitly specified toChars formatting options for floating point values. (The default format option, shortest round-trip, is specified implicitly by omitting the format argument.) Additional enumerators are reserved for future use: : e_HEX = 0x100 : e_GENERAL = e_SCIENTIFIC | e_FIXED and correspond to the C++17 std::chars_format hex, and general enumerators. See {Adding Formats} in the {Implementation Notes} of the implementation (.cpp) file.

Enumerator:
e_SCIENTIFIC 
e_FIXED 

Member Function Documentation

static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
char  value,
int  base = 10 
) [static]
static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
signed char  value,
int  base = 10 
) [static]
static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
unsigned char  value,
int  base = 10 
) [static]
static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
signed short int  value,
int  base = 10 
) [static]
static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
unsigned short int  value,
int  base = 10 
) [static]
static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
signed int  value,
int  base = 10 
) [static]
static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
unsigned int  value,
int  base = 10 
) [static]
static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
signed long int  value,
int  base = 10 
) [static]
static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
unsigned long int  value,
int  base = 10 
) [static]
static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
signed long long int  value,
int  base = 10 
) [static]
static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
unsigned long long int  value,
int  base = 10 
) [static]
static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
double  value 
) [static]
static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
float  value 
) [static]
static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
double  value,
Format  format 
) [static]
static char* bslalg::NumericFormatterUtil::toChars ( char *  first,
char *  last,
float  value,
Format  format 
) [static]

Write the specified value into the character buffer starting a the specified first and ending at the specified last, last not included. In integer conversions, if the optionally specified base argument is not present or specified, base 10 is used. In floating point conversions, if the optionally specified format argument is not present or specified, the Default Floating Point Format is used. If a format argument is specified (e_DECIMAL or e_SCIENTIFIC), the Shortest (Textual) Decimal Representation for Binary Floating Point Values is used in that format (that will produce the exact binary floating point value when converted back to the original type from text), but see possible exceptions under Special Floating Point Values. Return the address one past the last character (lowest order digit or last digit of the exponent) written on success, or 0 on failure. The only reason for failure is when the range [ first, last ) is not large enough to contain the result. The written result is to begin at first with leftover room following the return value. The behavior is undefined unless first <= last, and base is in the range [ 2 .. 36 ]. Note that the type bool for the value parameter is explicitly disabled in the "NOT IMPLEMENTED" private section, because bool would otherwise be promoted to int and printed as 0 or 1, instead of the (possibly) expected false and true; and bool is not an integral or numeric type either. Also note that these functions do not null-terminate the result.


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