Irrlicht 3D Engine: irr::core::string< T, TAlloc > Class Template Reference

| Irrlicht 3D Engine |

Public Types | Public Member Functions
irr::core::string< T, TAlloc > Class Template Reference

`#include <irrString.h>`

List of all members.

## Public Types

- typedef T char_type

## Public Member Functions

- string ()
    Default constructor.
- string (const string< T, TAlloc > &other)
    Constructor.
- template<class B , class A > string (const string< B, A > &other)
    Constructor from other string types.
- string (const double number)
    Constructs a string from a float.
- string (int number)
    Constructs a string from an int.
- string (unsigned int number)
    Constructs a string from an unsigned int.
- string (long number)
    Constructs a string from a long.
- string (unsigned long number)
    Constructs a string from an unsigned long.
- template<class B > string (const B *const c, u32 length)
    Constructor for copying a string from a pointer with a given length.
- template<class B > string (const B *const c)
    Constructor for unicode and ascii strings.
- ~string ()
    Destructor.
- string< T, TAlloc > & append (T character)
    Appends a character to this string.
- string< T, TAlloc > & append (const T *const other, u32 length=0xffffffff)
    Appends a char string to this string.
- string< T, TAlloc > & append (const string< T, TAlloc > &other)
    Appends a string to this string.
- string< T, TAlloc > & append (const string< T, TAlloc > &other, u32 length)
    Appends a string of the length l to this string.
- const T * c_str () const
    Returns character string.
- bool empty () const
- bool equals_ignore_case (const string< T, TAlloc > &other) const
    Compares the strings ignoring case.
- bool equals_substring_ignore_case (const string< T, TAlloc > &other, const s32 sourcePos=0) const
    Compares the strings ignoring case.
- bool equalsn (const string< T, TAlloc > &other, u32 n) const
    compares the first n characters of the strings
- bool equalsn (const T *const str, u32 n) const
    compares the first n characters of the strings
- string< T, TAlloc > & erase (u32 index)
    Erases a character from the string.
- template<class B > s32 find (const B *const str, const u32 start=0) const
    finds another string in this string
- s32 findFirst (T c) const
    finds first occurrence of character in string
- s32 findFirstChar (const T *const c, u32 count=1) const
    finds first occurrence of a character of a list in string
- template<class B > s32 findFirstCharNotInList (const B *const c, u32 count=1) const
    Finds first position of a character not in a given list.
- s32 findLast (T c, s32 start=-1) const
    finds last occurrence of character in string
- s32 findLastChar (const T *const c, u32 count=1) const
    finds last occurrence of a character of a list in string
- template<class B > s32 findLastCharNotInList (const B *const c, u32 count=1) const
    Finds last position of a character not in a given list.
- s32 findNext (T c, u32 startPos) const
    finds next occurrence of character in string
- T lastChar () const
    gets the last char of a string or null
- bool lower_ignore_case (const string< T, TAlloc > &other) const
    Compares the strings ignoring case.
- string< T, TAlloc > & make_lower ()
    Makes the string lower case.
- string< T, TAlloc > & make_upper ()
    Makes the string upper case.
- bool operator!= (const T *const str) const
    Inequality operator.
- bool operator!= (const string< T, TAlloc > &other) const
    Inequality operator.
- string< T, TAlloc > operator+ (const string< T, TAlloc > &other) const
    Append operator for other strings.
- template<class B > string< T, TAlloc > operator+ (const B *const c) const
    Append operator for strings, ascii and unicode.
- string< T, TAlloc > & operator+= (T c)
    Appends a character to this string.
- string< T, TAlloc > & operator+= (const T *const c)
    Appends a char string to this string.
- string< T, TAlloc > & operator+= (const string< T, TAlloc > &other)
    Appends a string to this string.
- string< T, TAlloc > & operator+= (const int i)
    Appends a string representation of a number to this string.
- string< T, TAlloc > & operator+= (const unsigned int i)
    Appends a string representation of a number to this string.
- string< T, TAlloc > & operator+= (const long i)
    Appends a string representation of a number to this string.
- string< T, TAlloc > & operator+= (const unsigned long i)
    Appends a string representation of a number to this string.
- string< T, TAlloc > & operator+= (const double i)
    Appends a string representation of a number to this string.
- string< T, TAlloc > & operator+= (const float i)
    Appends a string representation of a number to this string.
- bool operator< (const string< T, TAlloc > &other) const
    Is smaller comparator.
- string< T, TAlloc > & operator= (const string< T, TAlloc > &other)
    Assignment operator.
- template<class B , class A > string< T, TAlloc > & operator= (const string< B, A > &other)
    Assignment operator for other string types.
- template<class B > string< T, TAlloc > & operator= (const B *const c)
    Assignment operator for strings, ascii and unicode.
- bool operator== (const T *const str) const
    Equality operator.
- bool operator== (const string< T, TAlloc > &other) const
    Equality operator.
- T & operator[] (const u32 index)
    Direct access operator.
- const T & operator[] (const u32 index) const
    Direct access operator.
- string< T, TAlloc > & remove (T c)
    Removes characters from a string.
- string< T, TAlloc > & remove (const string< T, TAlloc > &toRemove)
    Removes a string from the string.
- string< T, TAlloc > & removeChars (const string< T, TAlloc > &characters)
    Removes characters from a string.
- string< T, TAlloc > & replace (T toReplace, T replaceWith)
    Replaces all characters of a special type with another one.
- string< T, TAlloc > & replace (const string< T, TAlloc > &toReplace, const string< T, TAlloc > &replaceWith)
    Replaces all instances of a string with another one.
- void reserve (u32 count)
    Reserves some memory.
- u32 size () const
    Returns length of the string's content.
- template<class container > u32 split (container &ret, const T *const c, u32 count=1, bool ignoreEmptyTokens=true, bool keepSeparators=false) const
    split string into parts.
- string< T > subString (u32 begin, s32 length, bool make_lower=false) const
    Returns a substring.
- string< T, TAlloc > & trim (const string< T, TAlloc > &whitespace=" \t\n\r")
    Trims the string.
- string< T, TAlloc > & validate ()
    verify the existing string.

## Detailed Description

### template<typename T, typename TAlloc = irrAllocator<T>>
class irr::core::string< T, TAlloc >

Definition at line 73 of file irrString.h.

## Member Typedef Documentation

template<typename T, typename TAlloc = irrAllocator<T>>

typedef T irr::core::string< T, TAlloc >::char_type

Definition at line 77 of file irrString.h.

## Constructor & Destructor Documentation

template<typename T, typename TAlloc = irrAllocator<T>>

irr::core::string< T, TAlloc >::string | ( |  | ) | `[inline]`

Default constructor.

Definition at line 80 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

irr::core::string< T, TAlloc >::string | ( | const string< T, TAlloc > & | other | ) | `[inline]`

Constructor.

Definition at line 89 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>
template<class B , class A >

irr::core::string< T, TAlloc >::string | ( | const string< B, A > & | other | ) | `[inline]`

Constructor from other string types.

Definition at line 97 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

irr::core::string< T, TAlloc >::string | ( | const double | number | ) | `[inline, explicit]`

Constructs a string from a float.

Definition at line 105 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

irr::core::string< T, TAlloc >::string | ( | int | number | ) | `[inline, explicit]`

Constructs a string from an int.

Definition at line 115 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

irr::core::string< T, TAlloc >::string | ( | unsigned int | number | ) | `[inline, explicit]`

Constructs a string from an unsigned int.

Definition at line 163 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

irr::core::string< T, TAlloc >::string | ( | long | number | ) | `[inline, explicit]`

Constructs a string from a long.

Definition at line 194 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

irr::core::string< T, TAlloc >::string | ( | unsigned long | number | ) | `[inline, explicit]`

Constructs a string from an unsigned long.

Definition at line 242 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>
template<class B >

irr::core::string< T, TAlloc >::string | ( | const B *const | c,
|  | u32 | length
| ) |  | `[inline]`

Constructor for copying a string from a pointer with a given length.

Definition at line 274 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>
template<class B >

irr::core::string< T, TAlloc >::string | ( | const B *const | c | ) | `[inline]`

Constructor for unicode and ascii strings.

Definition at line 296 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

irr::core::string< T, TAlloc >::~string | ( |  | ) | `[inline]`

Destructor.

Definition at line 304 of file irrString.h.

## Member Function Documentation

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::append | ( | T | character | ) | `[inline]`

Appends a character to this string.

Parameters:

  character,: | Character to append.

Definition at line 603 of file irrString.h.

Referenced by irr::core::string< fschar_t >::append(), irr::scene::quake3::dumpShader(), irr::scene::quake3::dumpVarGroup(), irr::scene::quake3::getTextures(), irr::core::string< fschar_t >::operator+(), and irr::core::string< fschar_t >::operator+=().

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::append | ( | const T *const | other,
|  | u32 | length = `0xffffffff`
| ) |  | `[inline]`

Appends a char string to this string.

Parameters:

  other,: | Char string to append.
  length,: | The length of the string to append.

Definition at line 620 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::append | ( | const string< T, TAlloc > & | other | ) | `[inline]`

Appends a string to this string.

Parameters:

  other,: | String to append.

Definition at line 652 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::append | ( | const string< T, TAlloc > & | other,
|  | u32 | length
| ) |  | `[inline]`

Appends a string of the length l to this string.

Parameters:

  other,: | other String to append to this string.
  length,: | How much characters of the other string to add to this one.

Definition at line 675 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

const T* irr::core::string< T, TAlloc >::c_str | ( |  | ) | const`[inline]`

Returns character string.

Returns:
  pointer to C-style NUL terminated string.

Definition at line 495 of file irrString.h.

Referenced by irr::core::deletePathFromFilename(), irr::gui::IGUIElement::deserializeAttributes(), irr::scene::ISceneNode::getName(), irr::gui::IGUIElement::getName(), irr::gui::IGUIElement::getText(), irr::scene::quake3::SVariable::operator<(), irr::scene::quake3::IShader::operator<(), irr::core::string< fschar_t >::operator=(), irr::scene::quake3::SVariable::operator==(), irr::scene::quake3::IShader::operator==(), irr::core::string< fschar_t >::replace(), irr::scene::ISceneNode::serializeAttributes(), and irr::gui::IGUIElement::serializeAttributes().

template<typename T, typename TAlloc = irrAllocator<T>>

bool irr::core::string< T, TAlloc >::empty | ( |  | ) | const`[inline]`

Informs if the string is empty or not.

Returns:
  True if the string is empty, false if not.

Definition at line 488 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

bool irr::core::string< T, TAlloc >::equals_ignore_case | ( | const string< T, TAlloc > & | other | ) | const`[inline]`

Compares the strings ignoring case.

Parameters:

  other,: | Other string to compare.

Returns:
  True if the strings are equal ignoring case.

Definition at line 522 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

bool irr::core::string< T, TAlloc >::equals_substring_ignore_case | ( | const string< T, TAlloc > & | other,
|  | const s32 | sourcePos = `0`
| ) |  | const`[inline]`

Compares the strings ignoring case.

Parameters:

  other,: | Other string to compare.
  sourcePos,: | where to start to compare in the string

Returns:
  True if the strings are equal ignoring case.

Definition at line 535 of file irrString.h.

Referenced by irr::core::isFileExtension().

template<typename T, typename TAlloc = irrAllocator<T>>

bool irr::core::string< T, TAlloc >::equalsn | ( | const string< T, TAlloc > & | other,
|  | u32 | n
| ) |  | const`[inline]`

compares the first n characters of the strings

Parameters:

  other | Other string to compare.
  n | Number of characters to compare

Returns:
  True if the n first characters of both strings are equal.

Definition at line 569 of file irrString.h.

Referenced by irr::core::isInSameDirectory().

template<typename T, typename TAlloc = irrAllocator<T>>

bool irr::core::string< T, TAlloc >::equalsn | ( | const T *const | str,
|  | u32 | n
| ) |  | const`[inline]`

compares the first n characters of the strings

Parameters:

  str | Other string to compare.
  n | Number of characters to compare

Returns:
  True if the n first characters of both strings are equal.

Definition at line 586 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::erase | ( | u32 | index | ) | `[inline]`

Erases a character from the string.

May be slow, because all elements following after the erased element have to be copied.

Parameters:

  index,: | Index of element to be erased.

Definition at line 1235 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>
template<class B >

s32 irr::core::string< T, TAlloc >::find | ( | const B *const | str,
|  | const u32 | start = `0`
| ) |  | const`[inline]`

finds another string in this string

Parameters:

  str,: | Another string
  start,: | Start position of the search

Returns:
  Positions where the string has been found, or -1 if not found.

Definition at line 859 of file irrString.h.

Referenced by irr::core::string< fschar_t >::replace().

template<typename T, typename TAlloc = irrAllocator<T>>

s32 irr::core::string< T, TAlloc >::findFirst | ( | T | c | ) | const`[inline]`

finds first occurrence of character in string

Parameters:

  c,: | Character to search for.

Returns:
  Position where the character has been found, or -1 if not found.

Definition at line 718 of file irrString.h.

Referenced by irr::core::fast_atof_move().

template<typename T, typename TAlloc = irrAllocator<T>>

s32 irr::core::string< T, TAlloc >::findFirstChar | ( | const T *const | c,
|  | u32 | count = `1`
| ) |  | const`[inline]`

finds first occurrence of a character of a list in string

Parameters:

  c,: | List of characters to find. For example if the method should find the first occurrence of 'a' or 'b', this parameter should be "ab".
  count,: | Amount of characters in the list. Usually, this should be strlen(c)

Returns:
  Position where one of the characters has been found, or -1 if not found.

Definition at line 734 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>
template<class B >

s32 irr::core::string< T, TAlloc >::findFirstCharNotInList | ( | const B *const | c,
|  | u32 | count = `1`
| ) |  | const`[inline]`

Finds first position of a character not in a given list.

Parameters:

  c,: | List of characters not to find. For example if the method should find the first occurrence of a character not 'a' or 'b', this parameter should be "ab".
  count,: | Amount of characters in the list. Usually, this should be strlen(c)

Returns:
  Position where the character has been found, or -1 if not found.

Definition at line 756 of file irrString.h.

Referenced by irr::core::string< fschar_t >::trim().

template<typename T, typename TAlloc = irrAllocator<T>>

s32 irr::core::string< T, TAlloc >::findLast | ( | T | c,
|  | s32 | start = `-1`
| ) |  | const`[inline]`

finds last occurrence of character in string

Parameters:

  c,: | Character to search for.
  start,: | start to search reverse ( default = -1, on end )

Returns:
  Position where the character has been found, or -1 if not found.

Definition at line 822 of file irrString.h.

Referenced by irr::core::cutFilenameExtension(), irr::core::getFileNameExtension(), and irr::core::isFileExtension().

template<typename T, typename TAlloc = irrAllocator<T>>

s32 irr::core::string< T, TAlloc >::findLastChar | ( | const T *const | c,
|  | u32 | count = `1`
| ) |  | const`[inline]`

finds last occurrence of a character of a list in string

Parameters:

  c,: | List of strings to find. For example if the method should find the last occurrence of 'a' or 'b', this parameter should be "ab".
  count,: | Amount of characters in the list. Usually, this should be strlen(c)

Returns:
  Position where one of the characters has been found, or -1 if not found.

Definition at line 839 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>
template<class B >

s32 irr::core::string< T, TAlloc >::findLastCharNotInList | ( | const B *const | c,
|  | u32 | count = `1`
| ) |  | const`[inline]`

Finds last position of a character not in a given list.

Parameters:

  c,: | List of characters not to find. For example if the method should find the first occurrence of a character not 'a' or 'b', this parameter should be "ab".
  count,: | Amount of characters in the list. Usually, this should be strlen(c)

Returns:
  Position where the character has been found, or -1 if not found.

Definition at line 783 of file irrString.h.

Referenced by irr::core::string< fschar_t >::trim().

template<typename T, typename TAlloc = irrAllocator<T>>

s32 irr::core::string< T, TAlloc >::findNext | ( | T | c,
|  | u32 | startPos
| ) |  | const`[inline]`

finds next occurrence of character in string

Parameters:

  c,: | Character to search for.
  startPos,: | Position in string to start searching.

Returns:
  Position where the character has been found, or -1 if not found.

Definition at line 807 of file irrString.h.

Referenced by irr::core::isInSameDirectory().

template<typename T, typename TAlloc = irrAllocator<T>>

T irr::core::string< T, TAlloc >::lastChar | ( |  | ) | const`[inline]`

gets the last char of a string or null

Definition at line 1274 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

bool irr::core::string< T, TAlloc >::lower_ignore_case | ( | const string< T, TAlloc > & | other | ) | const`[inline]`

Compares the strings ignoring case.

Parameters:

  other,: | Other string to compare.

Returns:
  True if this string is smaller ignoring case.

Definition at line 552 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::make_lower | ( |  | ) | `[inline]`

Makes the string lower case.

Definition at line 502 of file irrString.h.

Referenced by irr::io::SNamedPath::PathToName(), and irr::core::string< fschar_t >::subString().

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::make_upper | ( |  | ) | `[inline]`

Makes the string upper case.

Definition at line 511 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

bool irr::core::string< T, TAlloc >::operator!= | ( | const T *const | str | ) | const`[inline]`

Inequality operator.

Definition at line 465 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

bool irr::core::string< T, TAlloc >::operator!= | ( | const string< T, TAlloc > & | other | ) | const`[inline]`

Inequality operator.

Definition at line 472 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc> irr::core::string< T, TAlloc >::operator+ | ( | const string< T, TAlloc > & | other | ) | const`[inline]`

Append operator for other strings.

Definition at line 388 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>
template<class B >

string<T,TAlloc> irr::core::string< T, TAlloc >::operator+ | ( | const B *const | c | ) | const`[inline]`

Append operator for strings, ascii and unicode.

Definition at line 399 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::operator+= | ( | T | c | ) | `[inline]`

Appends a character to this string.

Parameters:

  c | Character to append.

Definition at line 925 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::operator+= | ( | const T *const | c | ) | `[inline]`

Appends a char string to this string.

Parameters:

  c | Char string to append.

Definition at line 934 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::operator+= | ( | const string< T, TAlloc > & | other | ) | `[inline]`

Appends a string to this string.

Parameters:

  other | String to append.

Definition at line 943 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::operator+= | ( | const int | i | ) | `[inline]`

Appends a string representation of a number to this string.

Parameters:

  i | Number to append.

Definition at line 952 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::operator+= | ( | const unsigned int | i | ) | `[inline]`

Appends a string representation of a number to this string.

Parameters:

  i | Number to append.

Definition at line 961 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::operator+= | ( | const long | i | ) | `[inline]`

Appends a string representation of a number to this string.

Parameters:

  i | Number to append.

Definition at line 970 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::operator+= | ( | const unsigned long | i | ) | `[inline]`

Appends a string representation of a number to this string.

Parameters:

  i | Number to append.

Definition at line 979 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::operator+= | ( | const double | i | ) | `[inline]`

Appends a string representation of a number to this string.

Parameters:

  i | Number to append.

Definition at line 988 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::operator+= | ( | const float | i | ) | `[inline]`

Appends a string representation of a number to this string.

Parameters:

  i | Number to append.

Definition at line 997 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

bool irr::core::string< T, TAlloc >::operator< | ( | const string< T, TAlloc > & | other | ) | const`[inline]`

Is smaller comparator.

Definition at line 451 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::operator= | ( | const string< T, TAlloc > & | other | ) | `[inline]`

Assignment operator.

Definition at line 311 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>
template<class B , class A >

string<T,TAlloc>& irr::core::string< T, TAlloc >::operator= | ( | const string< B, A > & | other | ) | `[inline]`

Assignment operator for other string types.

Definition at line 333 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>
template<class B >

string<T,TAlloc>& irr::core::string< T, TAlloc >::operator= | ( | const B *const | c | ) | `[inline]`

Assignment operator for strings, ascii and unicode.

Definition at line 342 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

bool irr::core::string< T, TAlloc >::operator== | ( | const T *const | str | ) | const`[inline]`

Equality operator.

Definition at line 425 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

bool irr::core::string< T, TAlloc >::operator== | ( | const string< T, TAlloc > & | other | ) | const`[inline]`

Equality operator.

Definition at line 440 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

T& irr::core::string< T, TAlloc >::operator[] | ( | const u32 | index | ) | `[inline]`

Direct access operator.

Definition at line 409 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

const T& irr::core::string< T, TAlloc >::operator[] | ( | const u32 | index | ) | const`[inline]`

Direct access operator.

Definition at line 417 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::remove | ( | T | c | ) | `[inline]`

Removes characters from a string.

Parameters:

  c,: | Character to remove.

Definition at line 1127 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::remove | ( | const string< T, TAlloc > & | toRemove | ) | `[inline]`

Removes a string from the string.

Parameters:

  toRemove,: | String to remove.

Definition at line 1149 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::removeChars | ( | const string< T, TAlloc > & | characters | ) | `[inline]`

Removes characters from a string.

Parameters:

  characters,: | Characters to remove.

Definition at line 1182 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::replace | ( | T | toReplace,
|  | T | replaceWith
| ) |  | `[inline]`

Replaces all characters of a special type with another one.

Parameters:

  toReplace | Character to replace.
  replaceWith | Character replacing the old one.

Definition at line 1007 of file irrString.h.

Referenced by irr::io::SNamedPath::PathToName(), and irr::core::string< fschar_t >::replace().

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::replace | ( | const string< T, TAlloc > & | toReplace,
|  | const string< T, TAlloc > & | replaceWith
| ) |  | `[inline]`

Replaces all instances of a string with another one.

Parameters:

  toReplace | The string to replace.
  replaceWith | The string replacing the old one.

Definition at line 1019 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

void irr::core::string< T, TAlloc >::reserve | ( | u32 | count | ) | `[inline]`

Reserves some memory.

Parameters:

  count,: | Amount of characters to reserve.

Definition at line 705 of file irrString.h.

Referenced by irr::core::string< fschar_t >::subString().

template<typename T, typename TAlloc = irrAllocator<T>>

u32 irr::core::string< T, TAlloc >::size | ( |  | ) | const`[inline]`

Returns length of the string's content.

Returns:
  Length of the string's content in characters, excluding the trailing NUL.

Definition at line 481 of file irrString.h.

Referenced by irr::core::string< fschar_t >::append(), irr::core::cutFilenameExtension(), irr::core::deletePathFromFilename(), irr::core::deletePathFromPath(), irr::core::string< fschar_t >::empty(), irr::scene::quake3::getCullingFunction(), irr::core::getFileNameExtension(), irr::core::isInSameDirectory(), irr::scene::quake3::SVariable::isValid(), irr::core::string< fschar_t >::operator=(), irr::core::string< fschar_t >::remove(), irr::core::string< fschar_t >::removeChars(), irr::core::string< fschar_t >::replace(), and irr::core::string< fschar_t >::subString().

template<typename T, typename TAlloc = irrAllocator<T>>
template<class container >

u32 irr::core::string< T, TAlloc >::split | ( | container & | ret,
|  | const T *const | c,
|  | u32 | count = `1`,
|  | bool | ignoreEmptyTokens = `true`,
|  | bool | keepSeparators = `false`
| ) |  | const`[inline]`

split string into parts.

This method will split a string at certain delimiter characters into the container passed in as reference. The type of the container has to be given as template parameter. It must provide a push_back and a size method.

Parameters:

  ret | The result container
  c | C-style string of delimiter characters
  count | Number of delimiter characters
  ignoreEmptyTokens | Flag to avoid empty substrings in the result container. If two delimiters occur without a character in between, an empty substring would be placed in the result. If this flag is set, only non-empty strings are stored.
  keepSeparators | Flag which allows to add the separator to the result string. If this flag is true, the concatenation of the substrings results in the original string. Otherwise, only the characters between the delimiters are returned.

Returns:
  The number of resulting substrings

Definition at line 1298 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T> irr::core::string< T, TAlloc >::subString | ( | u32 | begin,
|  | s32 | length,
|  | bool | make_lower = `false`
| ) |  | const`[inline]`

Returns a substring.

Parameters:

  begin | Start of substring.
  length | Length of substring.
  make_lower | copy only lower case

Definition at line 891 of file irrString.h.

Referenced by irr::core::cutFilenameExtension(), irr::core::getFileNameExtension(), and irr::core::string< fschar_t >::trim().

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::trim | ( | const string< T, TAlloc > & | whitespace = `" \t\n\r"` | ) | `[inline]`

Trims the string.

Removes the specified characters (by default, Latin-1 whitespace) from the begining and the end of the string.

Definition at line 1218 of file irrString.h.

template<typename T, typename TAlloc = irrAllocator<T>>

string<T,TAlloc>& irr::core::string< T, TAlloc >::validate | ( |  | ) | `[inline]`

verify the existing string.

Definition at line 1247 of file irrString.h.

Referenced by irr::core::deletePathFromPath().

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

- irrString.h