Keos::CStringConverter Class Reference

Utility class for string converting. More...

#include <KeosString.h>

List of all members.

Static Public Member Functions

static String ToString (float fVal, ushort nPrecision=6, ushort nWidth=0, char fill= ' ', std::ios::fmtflags flags=std::ios::fmtflags(0))
 Converts a Real to a String.
static String ToString (int nVal, unsigned short nWidth=0, char fill= ' ', std::ios::fmtflags flags=std::ios::fmtflags(0))
 Converts an int to a String.
static String ToString (bool bVal, bool bYesNo=false)
 Converts a boolean to a String.
static Real ParseReal (const String &strVal)
 Converts a String to a Real.
static int ParseInt (const String &strVal)
 Converts a String to a whole number.
static uint ParseUnsignedInt (const String &strVal)
 Converts a String to a whole number.
static long ParseLong (const String &strVal)
 Converts a String to a whole number.
static ulong ParseUnsignedLong (const String &strVal)
 Converts a String to a whole number.
static bool ParseBool (const String &strVal)
 Converts a String to a boolean.


Detailed Description

Utility class for string converting.

Definition at line 69 of file KeosString.h.


Member Function Documentation

String Keos::CStringConverter::ToString ( float  fVal,
ushort  nPrecision = 6,
ushort  nWidth = 0,
char  fill = ' ',
std::ios::fmtflags  flags = std::ios::fmtflags(0) 
) [static]

Converts a Real to a String.

Definition at line 105 of file KeosString.cpp.

Referenced by Keos::CRenderSystemCapabilities::Log(), and Keos::CException::SetFileLine().

String Keos::CStringConverter::ToString ( int  nVal,
unsigned short  nWidth = 0,
char  fill = ' ',
std::ios::fmtflags  flags = std::ios::fmtflags(0) 
) [static]

Converts an int to a String.

Definition at line 119 of file KeosString.cpp.

String Keos::CStringConverter::ToString ( bool  bVal,
bool  bYesNo = false 
) [static]

Converts a boolean to a String.

Parameters:
bVal Value to be converted.
bYesNo If set to true, result is 'yes' or 'no' instead of 'true' or 'false'.

Definition at line 132 of file KeosString.cpp.

Real Keos::CStringConverter::ParseReal ( const String strVal  )  [static]

Converts a String to a Real.

Returns:
0.0 if the value could not be parsed, otherwise the Real version of the String.

Definition at line 151 of file KeosString.cpp.

int Keos::CStringConverter::ParseInt ( const String strVal  )  [static]

Converts a String to a whole number.

Returns:
0.0 if the value could not be parsed, otherwise the numeric version of the String.

Definition at line 157 of file KeosString.cpp.

uint Keos::CStringConverter::ParseUnsignedInt ( const String strVal  )  [static]

Converts a String to a whole number.

Returns:
0.0 if the value could not be parsed, otherwise the numeric version of the String.

Definition at line 163 of file KeosString.cpp.

Referenced by Keos::COGLRenderSystem::Initialise(), and Keos::CD3D9RenderSystem::Initialise().

long Keos::CStringConverter::ParseLong ( const String strVal  )  [static]

Converts a String to a whole number.

Returns:
0.0 if the value could not be parsed, otherwise the numeric version of the String.

Definition at line 169 of file KeosString.cpp.

ulong Keos::CStringConverter::ParseUnsignedLong ( const String strVal  )  [static]

Converts a String to a whole number.

Returns:
0.0 if the value could not be parsed, otherwise the numeric version of the String.

Definition at line 175 of file KeosString.cpp.

bool Keos::CStringConverter::ParseBool ( const String strVal  )  [static]

Converts a String to a boolean.

Parameters:
strVal Accepts 'true' or 'false' as input.

Definition at line 181 of file KeosString.cpp.

Referenced by Keos::COGLRenderSystem::Initialise(), and Keos::CD3D9RenderSystem::Initialise().


The documentation for this class was generated from the following files:
Generated on Fri Mar 9 14:29:29 2007 for Keos by  doxygen 1.5.1-p1