HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_DigitsEXPR Class Reference

#include <UT_Digits.h>

+ Inheritance diagram for UT_DigitsEXPR:

Public Member Functions

 UT_DigitsEXPR (fpreal64 v)
 
 UT_DigitsEXPR (fpreal32 v)
 
- Public Member Functions inherited from UT_Digits
 UT_Digits ()
 Initialize to empty string. More...
 
void reset (fpreal64, Flags flags=GENERAL, int precision=-1)
 Change to a new 64-bit double. More...
 
void reset (fpreal32, Flags flags=GENERAL, int precision=-1)
 Change to a new 32-bit float. More...
 
void reset (fpreal16, Flags flags=GENERAL, int precision=-1)
 Change to a 16-bit IEEE "half". More...
 
void reset (int64, Flags flags=GENERAL, int precision=-1)
 Change to an integer. More...
 
void reset (int32, Flags flags=GENERAL, int precision=-1)
 Change to an integer. More...
 
void reset (uint64, Flags flags=GENERAL, int precision=-1)
 Change to an unsigned. More...
 
void reset (uint32, Flags flags=GENERAL, int precision=-1)
 Change to an unsigned. More...
 
 UT_Digits (fpreal64 i, Flags flags=GENERAL, int precision=-1)
 Constructors that do reset(i) More...
 
 UT_Digits (fpreal32 i, Flags flags=GENERAL, int precision=-1)
 
 UT_Digits (fpreal16 i, Flags flags=GENERAL, int precision=-1)
 
 UT_Digits (int64 i, Flags flags=GENERAL, int precision=-1)
 
 UT_Digits (int32 i, Flags flags=GENERAL, int precision=-1)
 
 UT_Digits (uint64 i, Flags flags=GENERAL, int precision=-1)
 
 UT_Digits (uint32 i, Flags flags=GENERAL, int precision=-1)
 
 UT_Digits (fpreal64 i, int precision)
 Constructors that take precision but no flags. More...
 
 UT_Digits (fpreal32 i, int precision)
 
 UT_Digits (fpreal16 i, int precision)
 
const char * c_str () const
 Return the formatted string, which is stored in an internal buffer. More...
 
const char * data () const
 Return the formatted string, which is stored in an internal buffer. More...
 
unsigned size () const
 Length of the string. More...
 
char operator[] (unsigned i) const
 get the bytes of the formatted text More...
 
 operator const char * () const
 Return the formatted string, which is stored in an internal buffer. More...
 
 operator fpreal64 () const
 
 operator bool () const
 Returns true if reset to a non-zero value. More...
 
bool operator!= (const char *) const
 String equality, useful for testing. More...
 
bool operator== (const char *v) const
 
void insert (unsigned i, const char *c, unsigned len)
 
void insert (unsigned i, char c, unsigned len=1)
 
void pad0 (Flags flags, int digits)
 add leading zeros so there are n digits More...
 
void grouping (Flags flags)
 insert commas every 3 leading digits (or _ every 4 for hex) More...
 
void prefix (Flags flags)
 add C prefix such as "0x" More...
 
void plus (bool space=false)
 add a '+' or ' ' to positive numbers More...
 
void uppercase ()
 
void append (char c)
 
char * write (char *start, char *end) const
 

Additional Inherited Members

- Public Types inherited from UT_Digits
enum  Flags {
  GENERAL = 0, FIXED = 1, SCIENTIFIC = 2, BINARY = 4,
  OCTAL = 8, HEX = 12, BASE = 12, E_PLUS = 16,
  E_2 = 32
}
 
- Static Public Member Functions inherited from UT_Digits
static to_chars_result to_chars (char *start, char *end, fpreal64 v, Flags flags=GENERAL, int precision=-1)
 
static to_chars_result to_chars (char *start, char *end, fpreal32 v, Flags flags=GENERAL, int precision=-1)
 
static to_chars_result to_chars (char *start, char *end, fpreal16 v, Flags flags=GENERAL, int precision=-1)
 
static to_chars_result to_chars (char *start, char *end, int64 v)
 
static to_chars_result to_chars (char *start, char *end, int32 v)
 
static to_chars_result to_chars (char *start, char *end, uint64 v)
 
static to_chars_result to_chars (char *start, char *end, uint32 v)
 
static Flags toFlags (int base)
 
static to_chars_result to_chars (char *start, char *end, int64 v, int base)
 
static to_chars_result to_chars (char *start, char *end, int32 v, int base)
 
static to_chars_result to_chars (char *start, char *end, uint64 v, int base)
 
static to_chars_result to_chars (char *start, char *end, uint32 v, int base)
 

Detailed Description

Replicate EXPRftoa() using UT_Digits, this avoids a temporary WorkBuffer. Larger precision makes any value that fits in an int64 print without an exponent. Also prints -0.0 as "0" for back-compatability

Definition at line 164 of file UT_Digits.h.

Constructor & Destructor Documentation

UT_DigitsEXPR::UT_DigitsEXPR ( fpreal64  v)
inline

Definition at line 167 of file UT_Digits.h.

UT_DigitsEXPR::UT_DigitsEXPR ( fpreal32  v)
inline

Definition at line 168 of file UT_Digits.h.


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