Home Libraries Author Links

stm::hexfmt< UnsignedT, DefaultFlags > Class Template Reference
[DivAids: Diverse Aids]

Inheritance diagram for stm::hexfmt< UnsignedT, DefaultFlags >:

Inheritance graph
[legend]
Collaboration diagram for stm::hexfmt< UnsignedT, DefaultFlags >:

Collaboration graph
[legend]

List of all members.


Detailed Description

template<typename UnsignedT, dword DefaultFlags = fmtflags::NoFlags>
class stm::hexfmt< UnsignedT, DefaultFlags >

Class template allowing to format the unsigned number held as hexadecimal string.

Examples:

gencrctest.cpp, and smartptrtest.cpp.

Definition at line 1193 of file divaids.hpp.


Public Types

typedef UnsignedT value_type
 Type of the value held by this object.

Public Member Functions

 hexfmt (value_type val=0, dword flags=defaultFlags)
 Construct an object holding the value val to be formatted with a prefix "0x" unless flag NoPrefix is set (default is defaultFlags & NoPrefix) with upper case hexadecimal digits unless flag LowerCase is set (default is defaultFlags & LowerCase).
 hexfmt (value_type val, bool noprefix)
 Construct an object holding the value val to be formatted with a prefix "0x" unless noprefix is true.
 operator UnsignedT () const
 Convert to the value held by this object.
dword flags () const
 Return the flags in effect.
dword flags (dword newFlags)
 Specify a new flags and return the previous ones.
bool noprefix () const
 Return the noprefix flag in effect.
bool noprefix (bool nopr)
 Specify a new noprefix flag and return the previous one.
template<class StringT>
 operator StringT () const
 Convert the value held by this object to the hexadecimal StringT representation according to the flags in effect.

Static Public Member Functions

template<class StringT, class IteratorT>
static StringT dump (IteratorT first, IteratorT last)
 Return a string containing the hex dump of the value_type range [*first, *last) without prefix "0x".

Static Public Attributes

static const dword defaultFlags = DefaultFlags
 Default flags.

Member Typedef Documentation

template<typename UnsignedT, dword DefaultFlags = fmtflags::NoFlags>
typedef UnsignedT stm::hexfmt< UnsignedT, DefaultFlags >::value_type

Type of the value held by this object.

Definition at line 1205 of file divaids.hpp.


Constructor & Destructor Documentation

template<typename UnsignedT, dword DefaultFlags = fmtflags::NoFlags>
stm::hexfmt< UnsignedT, DefaultFlags >::hexfmt ( value_type  val = 0,
dword  flags = defaultFlags 
)

Construct an object holding the value val to be formatted with a prefix "0x" unless flag NoPrefix is set (default is defaultFlags & NoPrefix) with upper case hexadecimal digits unless flag LowerCase is set (default is defaultFlags & LowerCase).

template<typename UnsignedT, dword DefaultFlags = fmtflags::NoFlags>
stm::hexfmt< UnsignedT, DefaultFlags >::hexfmt ( value_type  val,
bool  noprefix 
)

Construct an object holding the value val to be formatted with a prefix "0x" unless noprefix is true.


Member Function Documentation

template<typename UnsignedT, dword DefaultFlags = fmtflags::NoFlags>
stm::hexfmt< UnsignedT, DefaultFlags >::operator UnsignedT (  )  const

Convert to the value held by this object.

template<typename UnsignedT, dword DefaultFlags = fmtflags::NoFlags>
dword stm::hexfmt< UnsignedT, DefaultFlags >::flags (  )  const

Return the flags in effect.

template<typename UnsignedT, dword DefaultFlags = fmtflags::NoFlags>
dword stm::hexfmt< UnsignedT, DefaultFlags >::flags ( dword  newFlags  ) 

Specify a new flags and return the previous ones.

template<typename UnsignedT, dword DefaultFlags = fmtflags::NoFlags>
bool stm::hexfmt< UnsignedT, DefaultFlags >::noprefix (  )  const

Return the noprefix flag in effect.

template<typename UnsignedT, dword DefaultFlags = fmtflags::NoFlags>
bool stm::hexfmt< UnsignedT, DefaultFlags >::noprefix ( bool  nopr  ) 

Specify a new noprefix flag and return the previous one.

template<typename UnsignedT, dword DefaultFlags = fmtflags::NoFlags>
template<class StringT>
stm::hexfmt< UnsignedT, DefaultFlags >::operator StringT (  )  const

Convert the value held by this object to the hexadecimal StringT representation according to the flags in effect.

template<typename UnsignedT, dword DefaultFlags = fmtflags::NoFlags>
template<class StringT, class IteratorT>
static StringT stm::hexfmt< UnsignedT, DefaultFlags >::dump ( IteratorT  first,
IteratorT  last 
) [static]

Return a string containing the hex dump of the value_type range [*first, *last) without prefix "0x".


Member Data Documentation

template<typename UnsignedT, dword DefaultFlags = fmtflags::NoFlags>
const dword stm::hexfmt< UnsignedT, DefaultFlags >::defaultFlags = DefaultFlags [static]

Default flags.

Definition at line 1202 of file divaids.hpp.


© Copyright Tom Michaelis 2002-2007

Distributed under the SysToMath Software License (See the accompanying file license.txt or a copy at www.SysToMath.com).