XPopup: TString Class Reference

- Main Page
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# TString Class Reference

String and Token Management Class. More...

`#include <tstring.h>`

List of all members.

## Public Member Functions

void | deltok (int N, char *sepChars)
| blah
int | find (const char chr, int N)
| Function to find position or number of occurences of a char in the string.
int | find (const char *substring, int N)
| Function to find position or number of occurences of a substring in the string.
TString | gettok (int N, int M, char *sepChars)
| blah
TString | gettok (int N, char *sepChars)
| blah
void | instok (char *cToken, int N, char *sepChars)
| blah
size_t | len ()
| Returns string length.
int | numtok (char *sepChars)
| blah
TString | operator * (const int N)
| Symbol Overload - TString string Repetition.
void | operator *= (const int N)
| Symbol Overload - TString string Repetition.
bool | operator!= (const TString &tString)
| Symbol Overload - TString and TString comparison.
bool | operator!= (const char chr)
| Symbol Overload - TString and char comparison.
bool | operator!= (const char *cString)
| Symbol Overload - TString and char string comparison.
bool | operator!= (const int iNull)
| Symbol Overload - TString and NULL comparison.
TString | operator+ (const TString &tString)
| Symbol Overload - TString and TString concatenation.
TString | operator+ (const char chr)
| Symbol Overload - TString and char concatenation.
TString | operator+ (const char *cString)
| Symbol Overload - TString and char string concatenation.
void | operator+= (const TString &tString)
| Symbol Overload - TString and TString concatenation.
void | operator+= (const char chr)
| Symbol Overload - TString and char concatenation.
void | operator+= (const char *cString)
| Symbol Overload - TString and char string concatenation.
bool | operator< (const TString &tString)
| Symbol Overload - TString and TString comparison.
bool | operator< (const char chr)
| Symbol Overload - TString and char comparison.
bool | operator< (const char *cString)
| Symbol Overload - TString and char string comparison.
bool | operator<= (const TString &tString)
| Symbol Overload - TString and TString comparison.
bool | operator<= (const char chr)
| Symbol Overload - TString and char comparison.
bool | operator<= (const char *cString)
| Symbol Overload - TString and char string comparison.
void | operator= (const char chr)
| Symbol Overload - TString assignement from C char.
void | operator= (const char *cString)
| Symbol Overload - TString assignement from C char string.
bool | operator== (const TString &tString)
| Symbol Overload - TString and TString comparison.
bool | operator== (const char chr)
| Symbol Overload - TString and char comparison.
bool | operator== (const char *cString)
| Symbol Overload - TString and char string comparison.
bool | operator== (const int iNull)
| Symbol Overload - TString and NULL comparison.
bool | operator> (const TString &tString)
| Symbol Overload - TString and TString comparison.
bool | operator> (const char chr)
| Symbol Overload - TString and char comparison.
bool | operator> (const char *cString)
| Symbol Overload - TString and char string comparison.
bool | operator>= (const TString &tString)
| Symbol Overload - TString and TString comparison.
bool | operator>= (const char chr)
| Symbol Overload - TString and char comparison.
bool | operator>= (const char *cString)
| Symbol Overload - TString and char string comparison.
char & | operator[] (long int N)
| Symbol Overload - Array Subscript.
void | puttok (char *cToken, int N, char *sepChars)
| blah
int | replace (const char chr, const char rchr)
| blah!
int | replace (const char chr, const char *rString)
| blah!
int | replace (const char *subString, const char rchr)
| blah!
int | replace (const char *subString, const char *rString)
| blah!
TString | sub (int N, int M)
| Returns a substring of the initial string.
char * | to_chr ()
| Returns the string as a C char string.
void | trim ()
| blah
| TString (const TString &tString)
| Copy Constructor.
| TString (const char chr)
| Constructor input from C char.
| TString (const char *cString)
| Constructor input from C char string.
| TString ()
| Default Constructor.
| ~TString ()
| Destructor.

## Public Attributes

char * | m_pString
| String buffer.

## Private Member Functions

void | deleteString ()
| Deletes the allocated char buffer.

## Detailed Description

String and Token Management Class.

## Constructor & Destructor Documentation

TString::TString | ( | const char * | cString | ) |

Constructor input from C char string.

Parameters:

  | cString | Character string to initialize string to

TString::TString | ( | const char | chr | ) |

Constructor input from C char.

Parameters:

  | chr | Character to initialize string to

TString::TString | ( | const TString & | tString | ) |

Copy Constructor.

Parameters:

  | tString | TString object to copy

## Member Function Documentation

void TString::deltok | ( | int | N,
|  | char * | sepChars
| ) |

| blah blah

int TString::find | ( | const char * | substring,
|  | int | N
| ) |

Function to find position or number of occurences of a substring in the string.

Parameters:

  | substring | Substring to search
  | N | Nth substring to search (N = 0 > Total number of matches)

Returns:
  > Number of occurences (N = 0)
  > Starting position of substring
  > -1 if function fails or no substring was found

TString TString::gettok | ( | int | N,
|  | int | M,
|  | char * | sepChars
| ) |

| blah blah

TString TString::gettok | ( | int | N,
|  | char * | sepChars
| ) |

| blah blah

void TString::instok | ( | char * | cToken,
|  | int | N,
|  | char * | sepChars
| ) |

| blah blah

size_t TString::len | ( |  | ) |

Returns string length.

Returns:
  String length

int TString::numtok | ( | char * | sepChars | ) |

| blah blah

TString TString::operator * | ( | const int | N | ) |

Symbol Overload - TString string Repetition.

Parameters:

  | N | Number of repetitions

Returns:
  Returns a TString object of the the new string

Note:
  Using 0 for N makes the string being empty

void TString::operator *= | ( | const int | N | ) |

Symbol Overload - TString string Repetition.

Parameters:

  | N | Number of repetitions

Note:
  Using 0 for N makes the string being empty

bool TString::operator!= | ( | const TString & | tString | ) |

Symbol Overload - TString and TString comparison.

Parameters:

  | tString | TString object to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator!= | ( | const char | chr | ) |

Symbol Overload - TString and char comparison.

Parameters:

  | chr | Character to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator!= | ( | const char * | cString | ) |

Symbol Overload - TString and char string comparison.

Parameters:

  | cString | Character string to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator!= | ( | const int | iNull | ) |

Symbol Overload - TString and NULL comparison.

Parameters:

  | iNull | Value of comparison (usually 0 for NULL)

Returns:
  Returns true or false based on the comparison

TString TString::operator+ | ( | const TString & | tString | ) |

Symbol Overload - TString and TString concatenation.

Parameters:

  | tString | TString object to concatenate

Returns:
  Returns the new TString object

TString TString::operator+ | ( | const char | chr | ) |

Symbol Overload - TString and char concatenation.

Parameters:

  | chr | Character to concatenant

Returns:
  Returns the new TString object

TString TString::operator+ | ( | const char * | string | ) |

Symbol Overload - TString and char string concatenation.

Parameters:

  | cString | Character string to concatenate

Returns:
  Returns the new TString object

void TString::operator+= | ( | const TString & | tString | ) |

Symbol Overload - TString and TString concatenation.

Parameters:

  | tString | TString object to concatenate

void TString::operator+= | ( | const char | chr | ) |

Symbol Overload - TString and char concatenation.

Parameters:

  | chr | Character to concatenate

void TString::operator+= | ( | const char * | string | ) |

Symbol Overload - TString and char string concatenation.

Parameters:

  | cString | Character string to concatenate

bool TString::operator< | ( | const TString & | tString | ) |

Symbol Overload - TString and TString comparison.

Parameters:

  | tString | TString object to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator< | ( | const char | chr | ) |

Symbol Overload - TString and char comparison.

Parameters:

  | chr | Character to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator< | ( | const char * | cString | ) |

Symbol Overload - TString and char string comparison.

Parameters:

  | cString | Character string to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator<= | ( | const TString & | tString | ) |

Symbol Overload - TString and TString comparison.

Parameters:

  | tString | TString object to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator<= | ( | const char | chr | ) |

Symbol Overload - TString and char comparison.

Parameters:

  | chr | Character to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator<= | ( | const char * | cString | ) |

Symbol Overload - TString and char string comparison.

Parameters:

  | cString | Character string to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

void TString::operator= | ( | const char | chr | ) |

Symbol Overload - TString assignement from C char.

Parameters:

  | chr | Character to assign string to

void TString::operator= | ( | const char * | string | ) |

Symbol Overload - TString assignement from C char string.

Parameters:

  | cString | Character string to assign string to

bool TString::operator== | ( | const TString & | tString | ) |

Symbol Overload - TString and TString comparison.

Parameters:

  | tString | TString object to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator== | ( | const char | chr | ) |

Symbol Overload - TString and char comparison.

Parameters:

  | chr | Character to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator== | ( | const char * | string | ) |

Symbol Overload - TString and char string comparison.

Parameters:

  | cString | Character string to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator== | ( | const int | iNull | ) |

Symbol Overload - TString and NULL comparison.

Parameters:

  | iNull | Value of comparison (usually 0 for NULL)

Returns:
  Returns true or false based on the comparison

bool TString::operator> | ( | const TString & | tString | ) |

Symbol Overload - TString and TString comparison.

Parameters:

  | tString | TString object to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator> | ( | const char | chr | ) |

Symbol Overload - TString and char comparison.

Parameters:

  | chr | Character to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator> | ( | const char * | cString | ) |

Symbol Overload - TString and char string comparison.

Parameters:

  | cString | Character string to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator>= | ( | const TString & | tString | ) |

Symbol Overload - TString and TString comparison.

Parameters:

  | tString | TString object to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator>= | ( | const char | chr | ) |

Symbol Overload - TString and char comparison.

Parameters:

  | chr | Character to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

bool TString::operator>= | ( | const char * | cString | ) |

Symbol Overload - TString and char string comparison.

Parameters:

  | cString | Character string to compare

Returns:
  Returns true or false based on the comparison

Note:
  Comparison si based on a regular string comparison

  If the string in the TString object is empty, will return false

char & TString::operator[] | ( | long int | N | ) |

Symbol Overload - Array Subscript.

Parameters:

  | N | Character index

Returns:
  Returns the Nth char of string

Note:
  > Index starts at 0
  > Index can be negative, -1 being last character

void TString::puttok | ( | char * | cToken,
|  | int | N,
|  | char * | sepChars
| ) |

| blah blah

TString TString::sub | ( | int | N,
|  | int | M
| ) |

Returns a substring of the initial string.

Parameters:

  | N | start index
  | M | character count

Returns:
  returns a new TString object containing the substring

Note:
  > Index starts at 0
  > Index can be negative, -1 being the last character

void TString::trim | ( |  | ) |

| blah blah

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

- tstring.h
- tstring.cpp