Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

# 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

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 180 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 156 of file KeosString.cpp.

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 168 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 150 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 162 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 174 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.

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 | ( | 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.

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

- KeosEngine/KeosString.h
- KeosEngine/KeosString.cpp