cs sdk v 1.14 released

Home  |  Product  |  Documents  |  Tutorials  |  FAQ |   Download  |   Forum |   Contacts  |   Link  


  Cross Suit

 Cross Suit SDK

 Documents
      classes
 Starting...
           Tutorials

 LUA tutorials

   Support

  Forum
  q&a

 Product parts

 Virtual File system

 Virtual Render
 Virtual Machine
   

  Demo Games

   

 3D Engine

  gvSystem(dx9)

 Link

 

 

gvString< T > Class Template Reference

string template More...

#include <gv_arraylist.h>

Collaboration diagram for gvString< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 gvString ()
 Default constructor.
 gvString (const gvString< T > &other)
 Constructor.
 gvString (double number)
 Constructs a string from a float.
 gvString (int number)
 Constructs a string from an int.
template<class B>
 gvString (const B *c, signed int length)
 Constructor for copying a string from a pointer with a given length.
template<class B>
 gvString (const B *c)
 Constructor for unicode and ascii strings.
 ~gvString ()
 destructor
gvString< T > & operator= (const gvString< T > &other)
 Assignment operator.
template<class B>
gvString< T > & operator= (const B *c)
 Assignment operator for strings, ascii and unicode.
gvString< T > operator+ (const gvString< T > &other) const
 Add operator for other strings.
template<class B>
gvString< T > operator+ (const B *c) const
 Add operator for strings, ascii and unicode.
T & operator[] (const signed int index) const
 Direct access operator.
bool operator== (const T *str) const
 Comparison operator.
bool operator== (const gvString< T > &other) const
 Comparison operator.
bool operator< (const gvString< T > &other) const
 Is smaller operator.
bool operator!= (const T *str) const
 Equals not operator.
bool operator!= (const gvString< T > &other) const
 Equals not operator.
signed int size () const
 Returns length of string.
const T * c_str () const
 Returns character string.
void make_lower ()
 Makes the string lower case.
void make_upper ()
 Makes the string upper case.
bool equals_ignore_case (const gvString< T > &other) const
 Compares the string ignoring case.
bool equalsn (const gvString< T > &other, int len) const
 compares the first n characters of the strings
bool equalsn (const T *str, int len) const
 compares the first n characters of the strings
void append (T character)
 Appends a character to this string.
void append (const T *other)
 Appends a char string to this string.
void append (const gvString< T > &other)
 Appends a string to this string.
void append (const gvString< T > &other, signed int length)
 Appends a string of the length l to this string.
void reserve (signed int count)
 Reserves some memory.
signed int findFirst (T c) const
 finds first occurrence of character in string
signed int findFirstChar (T *c, int count) const
 finds first occurrence of a character of a list in string
template<class B>
signed int findFirstCharNotInList (B *c, int count) const
 Finds first position of a character not in a given list.
template<class B>
signed int findLastCharNotInList (B *c, int count) const
 Finds last position of a character not in a given list.
signed int findNext (T c, signed int startPos) const
 finds next occurrence of character in string
signed int findLast (T c) const
 finds last occurrence of character in string
template<class B>
signed int find (B *str) const
 finds another string in this string
gvString< T > subString (signed int begin, signed int length) const
 Returns a substring.
void operator+= (T c)
void operator+= (const T *c)
void operator+= (const gvString< T > &other)
void operator+= (int i)
void operator+= (double i)
void replace (T toReplace, T replaceWith)
 replaces all characters of a special type with another one
void trim ()
 trims the string.
void erase (int index)
 Erases a character from the string. May be slow, because all elements following after the erased element have to be copied.

Private Member Functions

toLower (const T &t) const
 Returns a character converted to lower case.
void reallocate (signed int new_size)
 Reallocate the array, make it bigger or smaller.

Private Attributes

T * array
signed int allocated
signed int used

Detailed Description

template<typename T>
class gvString< T >

string template

Definition at line 545 of file gv_arraylist.h.


Constructor & Destructor Documentation

template<typename T>
gvString< T >::gvString (  )  [inline]

Default constructor.

Definition at line 556 of file gv_arraylist.h.

template<typename T>
gvString< T >::gvString ( const gvString< T > &  other  )  [inline]

Constructor.

Definition at line 566 of file gv_arraylist.h.

template<typename T>
gvString< T >::gvString ( double  number  )  [inline]

Constructs a string from a float.

Definition at line 574 of file gv_arraylist.h.

template<typename T>
gvString< T >::gvString ( int  number  )  [inline]

Constructs a string from an int.

Definition at line 583 of file gv_arraylist.h.

template<typename T>
template<class B>
gvString< T >::gvString ( const B *  c,
signed int  length 
) [inline]

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

Definition at line 634 of file gv_arraylist.h.

References gvString< T >::allocated, and gvString< T >::array.

template<typename T>
template<class B>
gvString< T >::gvString ( const B *  c  )  [inline]

Constructor for unicode and ascii strings.

Definition at line 653 of file gv_arraylist.h.

template<typename T>
gvString< T >::~gvString (  )  [inline]

destructor

Definition at line 662 of file gv_arraylist.h.


Member Function Documentation

template<typename T>
gvString<T>& gvString< T >::operator= ( const gvString< T > &  other  )  [inline]

Assignment operator.

Definition at line 670 of file gv_arraylist.h.

template<typename T>
template<class B>
gvString<T>& gvString< T >::operator= ( const B *  c  )  [inline]

Assignment operator for strings, ascii and unicode.

Definition at line 692 of file gv_arraylist.h.

References gvString< T >::allocated, and gvString< T >::array.

template<typename T>
gvString<T> gvString< T >::operator+ ( const gvString< T > &  other  )  const [inline]

Add operator for other strings.

Definition at line 733 of file gv_arraylist.h.

template<typename T>
template<class B>
gvString<T> gvString< T >::operator+ ( const B *  c  )  const [inline]

Add operator for strings, ascii and unicode.

Definition at line 743 of file gv_arraylist.h.

References gvString< T >::append().

Here is the call graph for this function:

template<typename T>
T& gvString< T >::operator[] ( const signed int  index  )  const [inline]

Direct access operator.

Definition at line 754 of file gv_arraylist.h.

template<typename T>
bool gvString< T >::operator== ( const T *  str  )  const [inline]

Comparison operator.

Definition at line 763 of file gv_arraylist.h.

template<typename T>
bool gvString< T >::operator== ( const gvString< T > &  other  )  const [inline]

Comparison operator.

Definition at line 778 of file gv_arraylist.h.

template<typename T>
bool gvString< T >::operator< ( const gvString< T > &  other  )  const [inline]

Is smaller operator.

Definition at line 790 of file gv_arraylist.h.

template<typename T>
bool gvString< T >::operator!= ( const T *  str  )  const [inline]

Equals not operator.

Definition at line 802 of file gv_arraylist.h.

template<typename T>
bool gvString< T >::operator!= ( const gvString< T > &  other  )  const [inline]

Equals not operator.

Definition at line 810 of file gv_arraylist.h.

template<typename T>
signed int gvString< T >::size (  )  const [inline]

Returns length of string.

Returns:
Returns length of the string in characters.

Definition at line 819 of file gv_arraylist.h.

Referenced by gvString< T >::append().

template<typename T>
const T* gvString< T >::c_str (  )  const [inline]

Returns character string.

Returns:
Returns pointer to C-style zero terminated string.

Definition at line 828 of file gv_arraylist.h.

References gvString< T >::array.

template<typename T>
void gvString< T >::make_lower (  )  [inline]

Makes the string lower case.

Definition at line 836 of file gv_arraylist.h.

template<typename T>
void gvString< T >::make_upper (  )  [inline]

Makes the string upper case.

Definition at line 852 of file gv_arraylist.h.

template<typename T>
bool gvString< T >::equals_ignore_case ( const gvString< T > &  other  )  const [inline]

Compares the string ignoring case.

Parameters:
other,: Other string to compare.
Returns:
Returns true if the string are equal ignoring case.

Definition at line 870 of file gv_arraylist.h.

template<typename T>
bool gvString< T >::equalsn ( const gvString< T > &  other,
int  len 
) const [inline]

compares the first n characters of the strings

Definition at line 881 of file gv_arraylist.h.

template<typename T>
bool gvString< T >::equalsn ( const T *  str,
int  len 
) const [inline]

compares the first n characters of the strings

Definition at line 895 of file gv_arraylist.h.

template<typename T>
void gvString< T >::append ( character  )  [inline]

Appends a character to this string.

Parameters:
character,: Character to append.

Definition at line 912 of file gv_arraylist.h.

References gvString< T >::allocated, gvString< T >::array, and gvString< T >::reallocate().

Referenced by gvString< T >::operator+(), and gvString< T >::operator+=().

Here is the call graph for this function:

template<typename T>
void gvString< T >::append ( const T *  other  )  [inline]

Appends a char string to this string.

Parameters:
other,: Char string to append.

Definition at line 925 of file gv_arraylist.h.

References gvString< T >::allocated, gvString< T >::array, and gvString< T >::reallocate().

Here is the call graph for this function:

template<typename T>
void gvString< T >::append ( const gvString< T > &  other  )  [inline]

Appends a string to this string.

Parameters:
other,: String to append.

Definition at line 952 of file gv_arraylist.h.

References gvString< T >::allocated, gvString< T >::array, gvString< T >::reallocate(), and gvString< T >::size().

Here is the call graph for this function:

template<typename T>
void gvString< T >::append ( const gvString< T > &  other,
signed int  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 971 of file gv_arraylist.h.

template<typename T>
void gvString< T >::reserve ( signed int  count  )  [inline]

Reserves some memory.

Parameters:
count,: Amount of characters to reserve.

Definition at line 996 of file gv_arraylist.h.

References gvString< T >::allocated, and gvString< T >::reallocate().

Here is the call graph for this function:

template<typename T>
signed int gvString< T >::findFirst ( c  )  const [inline]

finds first occurrence of character in string

Parameters:
c,: Character to search for.
Returns:
Returns position where the character has been found, or -1 if not found.

Definition at line 1009 of file gv_arraylist.h.

template<typename T>
signed int gvString< T >::findFirstChar ( T *  c,
int  count 
) const [inline]

finds first occurrence of a character of a list in string

Parameters:
c,: List of strings to find. For example if the method should find the first occurance of 'a' or 'b', this parameter should be "ab".
count,: Amount of characters in the list. Ususally, this should be strlen(ofParameter1)
Returns:
Returns position where one of the character has been found, or -1 if not found.

Definition at line 1025 of file gv_arraylist.h.

template<typename T>
template<class B>
signed int gvString< T >::findFirstCharNotInList ( B *  c,
int  count 
) 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 occurance of a character not 'a' or 'b', this parameter should be "ab".
count,: Amount of characters in the list. Ususally, this should be strlen(ofParameter1)
Returns:
Returns position where the character has been found, or -1 if not found.

Definition at line 1047 of file gv_arraylist.h.

References gvString< T >::array.

template<typename T>
template<class B>
signed int gvString< T >::findLastCharNotInList ( B *  c,
int  count 
) 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 occurance of a character not 'a' or 'b', this parameter should be "ab".
count,: Amount of characters in the list. Ususally, this should be strlen(ofParameter1)
Returns:
Returns position where the character has been found, or -1 if not found.

Definition at line 1071 of file gv_arraylist.h.

References gvString< T >::array.

template<typename T>
signed int gvString< T >::findNext ( c,
signed int  startPos 
) const [inline]

finds next occurrence of character in string

Parameters:
c,: Character to search for.
startPos,: Position in string to start searching.
Returns:
Returns position where the character has been found, or -1 if not found.

Definition at line 1092 of file gv_arraylist.h.

template<typename T>
signed int gvString< T >::findLast ( c  )  const [inline]

finds last occurrence of character in string

Parameters:
c,: Character to search for.
Returns:
Returns position where the character has been found, or -1 if not found.

Definition at line 1103 of file gv_arraylist.h.

template<typename T>
template<class B>
signed int gvString< T >::find ( B *  str  )  const [inline]

finds another string in this string

Parameters:
str,: Another string
Returns:
Returns positions where the string has been found, or -1 if not found.

Definition at line 1114 of file gv_arraylist.h.

template<typename T>
gvString<T> gvString< T >::subString ( signed int  begin,
signed int  length 
) const [inline]

Returns a substring.

Parameters:
begin,: Start of substring.
length,: Length of substring.

Definition at line 1140 of file gv_arraylist.h.

template<typename T>
void gvString< T >::operator+= ( c  )  [inline]

Definition at line 1158 of file gv_arraylist.h.

template<typename T>
void gvString< T >::operator+= ( const T *  c  )  [inline]

Definition at line 1163 of file gv_arraylist.h.

template<typename T>
void gvString< T >::operator+= ( const gvString< T > &  other  )  [inline]

Definition at line 1168 of file gv_arraylist.h.

References gvString< T >::append().

Here is the call graph for this function:

template<typename T>
void gvString< T >::operator+= ( int  i  )  [inline]

Definition at line 1173 of file gv_arraylist.h.

References gvString< T >::append().

Here is the call graph for this function:

template<typename T>
void gvString< T >::operator+= ( double  i  )  [inline]

Definition at line 1178 of file gv_arraylist.h.

References gvString< T >::append().

Here is the call graph for this function:

template<typename T>
void gvString< T >::replace ( toReplace,
replaceWith 
) [inline]

replaces all characters of a special type with another one

Definition at line 1184 of file gv_arraylist.h.

template<typename T>
void gvString< T >::trim (  )  [inline]

trims the string.

Removes whitespace from begin and end of the string.

Definition at line 1193 of file gv_arraylist.h.

References gvString< T >::array.

template<typename T>
void gvString< T >::erase ( int  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 1212 of file gv_arraylist.h.

template<typename T>
T gvString< T >::toLower ( const T &  t  )  const [inline, private]

Returns a character converted to lower case.

Definition at line 1227 of file gv_arraylist.h.

template<typename T>
void gvString< T >::reallocate ( signed int  new_size  )  [inline, private]

Reallocate the array, make it bigger or smaller.

Definition at line 1236 of file gv_arraylist.h.

Referenced by gvString< T >::append(), and gvString< T >::reserve().


Member Data Documentation

template<typename T>
signed int gvString< T >::allocated [private]

template<typename T>
signed int gvString< T >::used [private]

Definition at line 551 of file gv_arraylist.h.


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

Copyright(C) gvSystem & GamePlus All Rights Reserved.