estring Class Reference

An extended string class. More...

#include <estring.h>

Collaboration diagram for estring:

Collaboration graph
[legend]
List of all members.

Public Types

enum  alignment { left, right, center }
 Alignment values for formatted strings. More...
enum  set_from_type {
  type_string, type_unsigned_int, type_int, type_unsigned_short,
  type_short, type_unsigned_long, type_long, type_unsigned_long_long,
  type_long_long, type_float, type_double, type_char_ptr,
  type_void_ptr, type_unknown
}
 The type last assigned. More...
typedef std::string value_type
 The type from which estring inherits, std::string.
typedef value_type::size_type size_type
 The size type.

Public Member Functions

void init (void)
 Initialize the estring object.
void clear (void)
 Erase the string value.
void reset (void)
 Erase and reinitialize.
 estring ()
 Default constructor.
size_type width (const size_type a_l)
 Set the width of a formatted string.
size_type width (void) const
 Retrieve the set width for formatted strings.
alignment align (const alignment a_alignment)
 Set the alignment used for formatted strings.
alignment align (void) const
 Retrieve the set alignment for formatted strings.
char left_fillchar (const char a_char)
 Set the fill character used to padd the left side of a formatted string.
char left_fillchar (void) const
 Retrieve the fill character used to padd the left side of a formatted string.
char right_fillchar (const char a_char)
 Set the fill character used to padd the right side of a formatted string.
char right_fillchar (void) const
 Retrieve the fill character used to padd the right side of a formatted string.
void fillchar (const char a_char)
 Set the fill character used for padding both the left and right side of a formatted string.
value_type fmt_str (void)
 Generate a formatted string.
value_type fmt_str (const size_type a_width, const alignment a_alignment, const char a_left_fill, const char a_right_fill)
 Set all the formatting options.
size_type precision (size_type a_p)
 Set the precision used in converting to/from fractional types.
size_type precision (void) const
 Retrieve the set precision used in fractional conversions.
const unsigned int base (const unsigned int a_base)
 Set the base used in numeric conversions.
const unsigned int base (void) const
 Retrieve the base used in numeric conversions.
const set_from_typeget_from_type (void) const
 Retrieve the type of value being held by this estring.
const estring_valueget_from_value (void) const
 Retrieve the typeless_value being held by this estring.
 estring (const estring &a_estr)
 Copy constructor for estring objects.
estringassign (const estring &a_estr)
 Assignment for estring objects.
estringoperator= (const estring &a_estr)
 Assignment operator for estring objects.
estringlower (void)
 Convert all characters to lowercase.
estringupper (void)
 Convert all characters to uppercase.
 estring (const char a_char)
 Copy constructor for chars.
estringassign (const char a_char)
 Assignment for chars.
estringoperator= (const char a_char)
 Assignment operator for chars.
 estring (const value_type &a_string)
 Copy constructor for std::string objects.
estringassign (const value_type &a_string)
 Assignment for std::string objects.
estringoperator= (const value_type &a_string)
 Assignment operator for std::string objects.
 estring (const unsigned int a_int)
 Copy constructor for unsigned ints.
estringassign (const unsigned int a_int)
 Assignment for unsigned ints.
estringoperator= (const unsigned int a_int)
 Assignment operator for unsigned ints.
 operator unsigned int () const
 Implicit conversion operator to an unsigned int.
 estring (const int a_int)
estringassign (const int a_int)
estringoperator= (const int a_int)
 operator int () const
 estring (const unsigned short a_short)
estringassign (const unsigned short a_short)
estringoperator= (const unsigned short a_short)
 operator unsigned short () const
 estring (const short a_short)
estringassign (const short a_short)
estringoperator= (const short a_short)
 operator short () const
 estring (const unsigned long a_long)
estringassign (const unsigned long a_long)
estringoperator= (const unsigned long a_long)
 operator unsigned long () const
 estring (const long a_long)
estringassign (const long a_long)
estringoperator= (const long a_long)
 operator long () const
 estring (const unsigned long long a_long)
estringassign (const unsigned long long a_long)
estringoperator= (const unsigned long long a_long)
 operator unsigned long long () const
 estring (const long long a_long)
estringassign (const long long a_long)
estringoperator= (const long long a_long)
 operator long long () const
 estring (char *const a_ptr)
estringassign (char *const a_ptr)
estringoperator= (char *const a_ptr)
 operator char * () const
 estring (void *const a_ptr)
estringassign (void *const a_ptr)
estringoperator= (void *const a_ptr)
 operator void * () const
 estring (const float a_float)
estringassign (const float a_float)
estringoperator= (const float a_float)
 estring (const float a_float, unsigned a_precision, unsigned int a_base=10)
estringassign (const float a_float, unsigned a_precision, unsigned int a_base=10)
 operator float () const
 estring (const double a_double)
estringassign (const double a_double)
estringoperator= (const double a_double)
 estring (const double a_double, unsigned a_precision, unsigned int a_base=10)
estringassign (const double a_double, unsigned a_precision, unsigned int a_base=10)
 operator double () const

Private Member Functions

template<class T>
void T_fraction_to_strings (const T &a_t, value_type &a_ws, value_type &a_fs)
 Helper member template function to convert a fractional type to an estring.
template<class T>
void T_integral_to_string (const T &a_t, value_type &a_str)
 Helper member template function to convert an integral type to an estring.
template<class T>
void T_string_to_integral (const value_type &a_str, T &a_t) const
 Helper member template function to convert a string to an integral type.
template<class T>
void T_string_to_signed_integral (const value_type &a_str, T &a_t) const
 Helper member template function to convert a string to a signed integral.
template<class T>
void T_string_to_fractional (const value_type &a_str, T &a_t) const
 Helper member template function to convert a string to a fractional.

Private Attributes

size_type m_precision
 The current fractional number precision.
unsigned int m_base
 The current numerical base.
size_type m_width
 The current formatting width.
alignment m_alignment
 The current formatting alignment.
char m_left_fillchar
 The current left-hand fill character.
char m_right_fillchar
 The current right-hand fill character.
set_from_type m_type
 The current value type.
estring_value m_value
 The current value.

Static Private Attributes

static const char * m_alphabet
 The alphabet used for any base from 2 to 36.
static const size_t m_alphabet_len
 The length of the alphabet.

Detailed Description

An extended string class.

Estring is a derivative of std::string with extra functionality added in order to fascilitate (a) the conversion to strings from other types, (b) special formatting of those converted strings, and (c) the conversion back from a string to some other type.

Definition at line 52 of file estring.h.


Member Typedef Documentation

typedef std::string estring::value_type

The type from which estring inherits, std::string.

Definition at line 56 of file estring.h.

typedef value_type::size_type estring::size_type

The size type.

Definition at line 59 of file estring.h.


Member Enumeration Documentation

enum estring::alignment

Alignment values for formatted strings.

Enumerator:
left  Left-justified.
right  Right-justified.
center  Centered.

Definition at line 62 of file estring.h.

enum estring::set_from_type

The type last assigned.

Enumerator:
type_string  std::string
type_unsigned_int  unsigned int
type_int  int
type_unsigned_short  unsigned short
type_short  short
type_unsigned_long  unsigned long
type_long  long
type_unsigned_long_long  unsigned long long
type_long_long  long long
type_float  float
type_double  double
type_char_ptr  char*
type_void_ptr  void*
type_unknown  unknown

Definition at line 72 of file estring.h.


Constructor & Destructor Documentation

estring::estring (  ) 

Default constructor.

Definition at line 417 of file estring.cc.

References init().

Here is the call graph for this function:

estring::estring ( const estring a_estr  ) 

Copy constructor for estring objects.

Variables:

Exceptions:

Definition at line 820 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( const char  a_char  ) 

Copy constructor for chars.

Exceptions:

Definition at line 912 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( const value_type a_string  ) 

Copy constructor for std::string objects.

Variables:

Exceptions:

Definition at line 968 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( const unsigned int  a_int  ) 

Copy constructor for unsigned ints.

Variables:

Exceptions:

Definition at line 1021 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( const int  a_int  ) 

Definition at line 1077 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( const unsigned short  a_short  ) 

Definition at line 1120 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( const short  a_short  ) 

Definition at line 1159 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( const unsigned long  a_long  ) 

Definition at line 1202 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( const long  a_long  ) 

Definition at line 1241 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( const unsigned long long  a_long  ) 

Definition at line 1284 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( const long long  a_long  ) 

Definition at line 1323 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( char *const   a_ptr  ) 

Definition at line 1366 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( void *const   a_ptr  ) 

Definition at line 1407 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( const float  a_float  ) 

Definition at line 1449 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( const float  a_float,
unsigned  a_precision,
unsigned int  a_base = 10 
)

Definition at line 1483 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( const double  a_double  ) 

Definition at line 1516 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:

estring::estring ( const double  a_double,
unsigned  a_precision,
unsigned int  a_base = 10 
)

Definition at line 1550 of file estring.cc.

References assign(), and init().

Here is the call graph for this function:


Member Function Documentation

void estring::init ( void   ) 

Initialize the estring object.

Defaults:

Definition at line 387 of file estring.cc.

References left, m_alignment, m_base, m_left_fillchar, m_precision, m_right_fillchar, m_type, m_width, and type_unknown.

Referenced by estring(), and reset().

void estring::clear ( void   ) 

Erase the string value.

Definition at line 400 of file estring.cc.

Referenced by archive_manager::archive(), and reset().

void estring::reset ( void   ) 

Erase and reinitialize.

Definition at line 407 of file estring.cc.

References clear(), and init().

Referenced by timestamp::make_str_(), and test3().

Here is the call graph for this function:

estring::size_type estring::width ( const size_type  a_l  ) 

Set the width of a formatted string.

Variables:

Returns:

Definition at line 432 of file estring.cc.

References m_width.

Referenced by timestamp::make_str_(), num_to_string(), percent_string(), test1(), table::write(), table_cell_table::write(), and table_cell_estring::write().

estring::size_type estring::width ( void   )  const

Retrieve the set width for formatted strings.

Returns:

Definition at line 447 of file estring.cc.

References m_width.

Referenced by fmt_str().

estring::alignment estring::align ( const alignment  a_alignment  ) 

Set the alignment used for formatted strings.

Vaiables:

Definition at line 457 of file estring.cc.

References m_alignment.

Referenced by report_manager::format_synopsis(), jobs_report::format_synopsis(), vault_report::format_synopsis(), timestamp::make_str_(), num_to_string(), percent_string(), test1(), test4(), jobs_report::write_report(), and vault_report::write_report().

estring::alignment estring::align ( void   )  const

Retrieve the set alignment for formatted strings.

Returns:

Definition at line 472 of file estring.cc.

References m_alignment.

Referenced by fmt_str().

char estring::left_fillchar ( const char  a_char  ) 

Set the fill character used to padd the left side of a formatted string.

Variables:

Returns:

Definition at line 589 of file estring.cc.

References m_left_fillchar.

Referenced by timestamp::make_str_(), and test1().

char estring::left_fillchar ( void   )  const

Retrieve the fill character used to padd the left side of a formatted string.

Returns:

Definition at line 606 of file estring.cc.

References m_left_fillchar.

Referenced by fillchar(), and fmt_str().

char estring::right_fillchar ( const char  a_char  ) 

Set the fill character used to padd the right side of a formatted string.

Variables:

Returns:

Definition at line 620 of file estring.cc.

References m_right_fillchar.

char estring::right_fillchar ( void   )  const

Retrieve the fill character used to padd the right side of a formatted string.

Returns:

Definition at line 637 of file estring.cc.

References m_right_fillchar.

Referenced by fillchar(), and fmt_str().

void estring::fillchar ( const char  a_char  ) 

Set the fill character used for padding both the left and right side of a formatted string.

Variables:

Definition at line 648 of file estring.cc.

References left_fillchar(), and right_fillchar().

Referenced by report_manager::mf_write_header(), percent_string(), jobs_report::write_report(), and vault_report::write_report().

Here is the call graph for this function:

estring::value_type estring::fmt_str ( void   ) 

Generate a formatted string.

Returns:

If the string being printed is wider than the assigned width then as many as three periods are used ("...") to denote that the contents of the string have been truncated. For strings that use left alignment these three periods are printed on the right-hand side of the string, while showing as many characters on the left as possible beginning with the left-most character. For strings that use right alignment these three periods are printed on the left-hand side of the string, while showing as many characters on the right as possible includingn the right-most character. For strings that are center-aligned as many characters on both the left and the right are printed, including the left-most and the right-most characters, while characters in the center of the string are replaced with the three periods.

Definition at line 674 of file estring.cc.

References left, m_alignment, m_left_fillchar, m_right_fillchar, m_width, right, and TRY_nomem.

Referenced by fmt_str(), timestamp::make_str_(), num_to_string(), percent_string(), test1(), test2(), table::write(), table_cell_table::write(), and table_cell_estring::write().

estring::value_type estring::fmt_str ( const size_type  a_width,
const alignment  a_alignment,
const char  a_left_fill,
const char  a_right_fill 
)

Set all the formatting options.

Variables:

Returns:

Definition at line 770 of file estring.cc.

References align(), fmt_str(), left_fillchar(), right_fillchar(), and width().

Here is the call graph for this function:

estring::size_type estring::precision ( size_type  a_p  ) 

Set the precision used in converting to/from fractional types.

Variables:

Returns:

Definition at line 487 of file estring.cc.

References assign(), m_precision, m_type, m_value, type_double, type_float, and estring_value::value.

Referenced by percent_string(), test2(), and test3().

Here is the call graph for this function:

estring::size_type estring::precision ( void   )  const

Retrieve the set precision used in fractional conversions.

Returns:

Definition at line 507 of file estring.cc.

References m_precision.

Referenced by assign().

const unsigned int estring::base ( const unsigned int  a_base  ) 

Set the base used in numeric conversions.

Variables:

Return:

Exceptions:

Definition at line 526 of file estring.cc.

References assign(), ERROR, m_alphabet_len, m_base, m_type, m_value, TRY_nomem, type_double, type_float, type_int, type_long, type_long_long, type_short, type_unsigned_int, type_unsigned_long, type_unsigned_long_long, type_unsigned_short, and estring_value::value.

Referenced by test3(), and test4().

Here is the call graph for this function:

const unsigned int estring::base ( void   )  const

Retrieve the base used in numeric conversions.

Returns:

Definition at line 575 of file estring.cc.

References m_base.

Referenced by assign().

const estring::set_from_type & estring::get_from_type ( void   )  const

Retrieve the type of value being held by this estring.

Returns:

Definition at line 796 of file estring.cc.

References m_type.

Referenced by test4().

const estring_value & estring::get_from_value ( void   )  const

Retrieve the typeless_value being held by this estring.

Returns:

Definition at line 807 of file estring.cc.

References m_value.

estring & estring::assign ( const estring a_estr  ) 

Assignment for estring objects.

Variables:

Returns:

Exceptions:

Definition at line 839 of file estring.cc.

References m_alignment, m_left_fillchar, m_precision, m_right_fillchar, m_type, m_value, m_width, and TRY_nomem.

Referenced by assign(), base(), estring(), operator=(), precision(), and test2().

estring & estring::operator= ( const estring a_estr  ) 

Assignment operator for estring objects.

Variables:

Returns:

Exceptions:

Definition at line 864 of file estring.cc.

References assign().

Here is the call graph for this function:

estring & estring::lower ( void   ) 

Convert all characters to lowercase.

Returns:

Definition at line 877 of file estring.cc.

Referenced by test5().

estring & estring::upper ( void   ) 

Convert all characters to uppercase.

Returns:

Definition at line 894 of file estring.cc.

Referenced by test5().

estring & estring::assign ( const char  a_char  ) 

Assignment for chars.

Variables:

Returns:

Exceptions:

Definition at line 929 of file estring.cc.

References m_type, TRY_nomem, and type_string.

estring & estring::operator= ( const char  a_char  ) 

Assignment operator for chars.

Variables:

Returns:

Exceptions:

Definition at line 951 of file estring.cc.

References assign().

Here is the call graph for this function:

estring & estring::assign ( const value_type a_string  ) 

Assignment for std::string objects.

Variables:

Returns:

Exceptions:

Definition at line 985 of file estring.cc.

References m_type, TRY_nomem, and type_string.

estring & estring::operator= ( const value_type a_string  ) 

Assignment operator for std::string objects.

Variables:

Returns:

Exceptions:

Definition at line 1004 of file estring.cc.

References assign().

Here is the call graph for this function:

estring & estring::assign ( const unsigned int  a_int  ) 

Assignment for unsigned ints.

Variables:

Returns:

Exceptions:

Definition at line 1040 of file estring.cc.

References estring_value::clear(), m_type, m_value, T_integral_to_string(), TRY, TRY_nomem, type_unsigned_int, and estring_value::value.

Here is the call graph for this function:

estring & estring::operator= ( const unsigned int  a_int  ) 

Assignment operator for unsigned ints.

Definition at line 1056 of file estring.cc.

References assign().

Here is the call graph for this function:

estring::operator unsigned int (  )  const

Implicit conversion operator to an unsigned int.

Definition at line 1065 of file estring.cc.

References T_string_to_integral(), and TRY.

Here is the call graph for this function:

estring & estring::assign ( const int  a_int  ) 

Definition at line 1083 of file estring.cc.

References assign(), estring_value::clear(), m_type, m_value, TRY, TRY_nomem, type_int, and estring_value::value.

Here is the call graph for this function:

estring & estring::operator= ( const int  a_int  ) 

Definition at line 1101 of file estring.cc.

References assign().

Here is the call graph for this function:

estring::operator int (  )  const

Definition at line 1108 of file estring.cc.

References T_string_to_signed_integral(), and TRY.

Here is the call graph for this function:

estring & estring::assign ( const unsigned short  a_short  ) 

Definition at line 1126 of file estring.cc.

References estring_value::clear(), m_type, m_value, T_integral_to_string(), TRY, TRY_nomem, type_unsigned_short, and estring_value::value.

Here is the call graph for this function:

estring & estring::operator= ( const unsigned short  a_short  ) 

Definition at line 1140 of file estring.cc.

References assign().

Here is the call graph for this function:

estring::operator unsigned short (  )  const

Definition at line 1147 of file estring.cc.

References T_string_to_integral(), and TRY.

Here is the call graph for this function:

estring & estring::assign ( const short  a_short  ) 

Definition at line 1165 of file estring.cc.

References assign(), estring_value::clear(), m_type, m_value, TRY, TRY_nomem, type_short, and estring_value::value.

Here is the call graph for this function:

estring & estring::operator= ( const short  a_short  ) 

Definition at line 1183 of file estring.cc.

References assign().

Here is the call graph for this function:

estring::operator short (  )  const

Definition at line 1190 of file estring.cc.

References T_string_to_signed_integral(), and TRY.

Here is the call graph for this function:

estring & estring::assign ( const unsigned long  a_long  ) 

Definition at line 1208 of file estring.cc.

References estring_value::clear(), m_type, m_value, T_integral_to_string(), TRY, TRY_nomem, type_unsigned_long, and estring_value::value.

Here is the call graph for this function:

estring & estring::operator= ( const unsigned long  a_long  ) 

Definition at line 1222 of file estring.cc.

References assign().

Here is the call graph for this function:

estring::operator unsigned long (  )  const

Definition at line 1229 of file estring.cc.

References T_string_to_integral(), and TRY.

Here is the call graph for this function:

estring & estring::assign ( const long  a_long  ) 

Definition at line 1247 of file estring.cc.

References assign(), estring_value::clear(), m_type, m_value, TRY, TRY_nomem, type_long, and estring_value::value.

Here is the call graph for this function:

estring & estring::operator= ( const long  a_long  ) 

Definition at line 1265 of file estring.cc.

References assign().

Here is the call graph for this function:

estring::operator long (  )  const

Definition at line 1272 of file estring.cc.

References T_string_to_signed_integral(), and TRY.

Here is the call graph for this function:

estring & estring::assign ( const unsigned long long  a_long  ) 

Definition at line 1290 of file estring.cc.

References estring_value::clear(), m_type, m_value, T_integral_to_string(), TRY, TRY_nomem, type_unsigned_long_long, and estring_value::value.

Here is the call graph for this function:

estring & estring::operator= ( const unsigned long long  a_long  ) 

Definition at line 1304 of file estring.cc.

References assign().

Here is the call graph for this function:

estring::operator unsigned long long (  )  const

Definition at line 1311 of file estring.cc.

References T_string_to_integral(), and TRY.

Here is the call graph for this function:

estring & estring::assign ( const long long  a_long  ) 

Definition at line 1329 of file estring.cc.

References assign(), estring_value::clear(), m_type, m_value, TRY, TRY_nomem, type_long_long, and estring_value::value.

Here is the call graph for this function:

estring & estring::operator= ( const long long  a_long  ) 

Definition at line 1347 of file estring.cc.

References assign().

Here is the call graph for this function:

estring::operator long long (  )  const

Definition at line 1354 of file estring.cc.

References T_string_to_signed_integral(), and TRY.

Here is the call graph for this function:

estring & estring::assign ( char *const   a_ptr  ) 

Definition at line 1372 of file estring.cc.

References assign(), estring_value::clear(), m_type, m_value, TRY_nomem, type_char_ptr, and estring_value::value.

Here is the call graph for this function:

estring & estring::operator= ( char *const   a_ptr  ) 

Definition at line 1385 of file estring.cc.

References assign().

Here is the call graph for this function:

estring::operator char * (  )  const

Definition at line 1392 of file estring.cc.

References ERROR, m_type, m_value, type_char_ptr, type_void_ptr, and estring_value::value.

estring & estring::assign ( void *const   a_ptr  ) 

Definition at line 1413 of file estring.cc.

References estring_value::clear(), m_type, m_value, TRY_nomem, type_void_ptr, and estring_value::value.

Here is the call graph for this function:

estring & estring::operator= ( void *const   a_ptr  ) 

Definition at line 1427 of file estring.cc.

References assign().

Here is the call graph for this function:

estring::operator void * (  )  const

Definition at line 1434 of file estring.cc.

References ERROR, m_type, m_value, type_char_ptr, type_void_ptr, and estring_value::value.

estring & estring::assign ( const float  a_float  ) 

Definition at line 1455 of file estring.cc.

References estring_value::clear(), m_type, m_value, T_fraction_to_strings(), TRY, TRY_nomem, type_float, and estring_value::value.

Here is the call graph for this function:

estring & estring::operator= ( const float  a_float  ) 

Definition at line 1476 of file estring.cc.

References assign().

Here is the call graph for this function:

estring & estring::assign ( const float  a_float,
unsigned  a_precision,
unsigned int  a_base = 10 
)

Definition at line 1490 of file estring.cc.

References assign(), base(), and precision().

Here is the call graph for this function:

estring::operator float (  )  const

Definition at line 1504 of file estring.cc.

References T_string_to_fractional(), and TRY.

Here is the call graph for this function:

estring & estring::assign ( const double  a_double  ) 

Definition at line 1522 of file estring.cc.

References estring_value::clear(), m_type, m_value, T_fraction_to_strings(), TRY, TRY_nomem, type_double, and estring_value::value.

Here is the call graph for this function:

estring & estring::operator= ( const double  a_double  ) 

Definition at line 1543 of file estring.cc.

References assign().

Here is the call graph for this function:

estring & estring::assign ( const double  a_double,
unsigned  a_precision,
unsigned int  a_base = 10 
)

Definition at line 1557 of file estring.cc.

References assign(), and precision().

Here is the call graph for this function:

estring::operator double (  )  const

Definition at line 1571 of file estring.cc.

References T_string_to_fractional(), and TRY.

Here is the call graph for this function:

template<class T>
void estring::T_fraction_to_strings ( const T &  a_t,
value_type a_ws,
value_type a_fs 
) [private]

Helper member template function to convert a fractional type to an estring.

Fractions are converted to string form using a default base of 10 unless specified otherwise through the base() member function. For bases greater than ten the letters of the alphabet are used, starting with 'a' for eleven, 'b' for twelve, etc.

By default a precision of 1 digit to the right of the decimal point is used unless specified otherwise by the precision() member function.

Variables:

Exceptions:

Definition at line 101 of file estring.cc.

References ASSERT, m_alphabet, m_alphabet_len, m_base, m_precision, and TRY_nomem.

Referenced by assign().

template<class T>
void estring::T_integral_to_string ( const T &  a_t,
value_type a_str 
) [private]

Helper member template function to convert an integral type to an estring.

Integrals are converted to string form using a default base of 10 unless specified otherwise through the base() member function. For bases greater than ten the letters of the alphabet are used, starting with 'a' for eleven, 'b' for twelve, etc.

Variables:

Exceptions:

Definition at line 59 of file estring.cc.

References ASSERT, m_alphabet, m_alphabet_len, m_base, and TRY_nomem.

Referenced by assign().

template<class T>
void estring::T_string_to_integral ( const value_type a_str,
T &  a_t 
) const [private]

Helper member template function to convert a string to an integral type.

Characters in the string are converted using a default base of 10 unless specified otherwise through the base() member function. For bases greater than ten the letters of the alphabet will be assumed, starting with 'a' for eleven, 'b' for twelve, etc.

Variables:

Exceptions:

Definition at line 183 of file estring.cc.

References ASSERT, ERROR, m_alphabet, m_alphabet_len, m_base, and TRY_nomem.

Referenced by operator unsigned int(), operator unsigned long(), operator unsigned long long(), operator unsigned short(), T_string_to_fractional(), and T_string_to_signed_integral().

template<class T>
void estring::T_string_to_signed_integral ( const value_type a_str,
T &  a_t 
) const [private]

Helper member template function to convert a string to a signed integral.

Variables:

Exceptions:

Definition at line 263 of file estring.cc.

References T_string_to_integral(), and TRY_nomem.

Referenced by operator int(), operator long(), operator long long(), and operator short().

Here is the call graph for this function:

template<class T>
void estring::T_string_to_fractional ( const value_type a_str,
T &  a_t 
) const [private]

Helper member template function to convert a string to a fractional.

Variables:

Exceptions:

Definition at line 299 of file estring.cc.

References ASSERT, ERROR, m_alphabet_len, m_base, T_string_to_integral(), TRY, and TRY_nomem.

Referenced by operator double(), and operator float().

Here is the call graph for this function:


Member Data Documentation

size_type estring::m_precision [private]

The current fractional number precision.

Definition at line 237 of file estring.h.

Referenced by assign(), init(), precision(), and T_fraction_to_strings().

unsigned int estring::m_base [private]

The current numerical base.

Definition at line 239 of file estring.h.

Referenced by base(), init(), T_fraction_to_strings(), T_integral_to_string(), T_string_to_fractional(), and T_string_to_integral().

const char * estring::m_alphabet [static, private]

The alphabet used for any base from 2 to 36.

Definition at line 241 of file estring.h.

Referenced by T_fraction_to_strings(), T_integral_to_string(), and T_string_to_integral().

const size_t estring::m_alphabet_len [static, private]

The length of the alphabet.

Definition at line 243 of file estring.h.

Referenced by base(), T_fraction_to_strings(), T_integral_to_string(), T_string_to_fractional(), and T_string_to_integral().

size_type estring::m_width [private]

The current formatting width.

Definition at line 245 of file estring.h.

Referenced by assign(), fmt_str(), init(), and width().

alignment estring::m_alignment [private]

The current formatting alignment.

Definition at line 247 of file estring.h.

Referenced by align(), assign(), fmt_str(), and init().

char estring::m_left_fillchar [private]

The current left-hand fill character.

Definition at line 249 of file estring.h.

Referenced by assign(), fmt_str(), init(), and left_fillchar().

char estring::m_right_fillchar [private]

The current right-hand fill character.

Definition at line 251 of file estring.h.

Referenced by assign(), fmt_str(), init(), and right_fillchar().

set_from_type estring::m_type [private]

The current value type.

Definition at line 253 of file estring.h.

Referenced by assign(), base(), get_from_type(), init(), operator char *(), operator void *(), and precision().

estring_value estring::m_value [private]

The current value.

Definition at line 255 of file estring.h.

Referenced by assign(), base(), get_from_value(), operator char *(), operator void *(), and precision().


The documentation for this class was generated from the following files:
Generated on Tue Jul 1 12:11:31 2008 for rvm by  doxygen 1.5.1