FBString Class Reference
 
 
 
FBString Class Reference

#include <fbstring.h>


Class Description

Basic string class.

Provides basic string manipulation functionality (dynamic sizing, operator overloads).

Definition at line 66 of file fbstring.h.

Public Member Functions

  FBString ()
  Constructor.
  FBString (const char *pStr)
  Constructor from a string.
  FBString (const FBString &pStr)
  Copy constructor.
  FBString (const char *p1Str, const char *p2Str)
  Constructor from the concatenation of two strings.
  ~FBString ()
  Destructor.
  operator char * () const
  Overloaded char* conversion operator.
  operator const char * () const
char  operator[] (unsigned int pIndex) const
  Overloaded [] operator.
const FBString operator= (const char *pStr)
  Overloaded = operator with a string.
const FBString operator= (const FBString &pStr)
  Overloaded = operator with an FBString.
bool  operator== (const FBString &pStr) const
  Overloaded == operator with a string.
bool  operator== (const char *pStr) const
bool  operator== (char *pStr) const
bool  operator!= (const FBString &pStr) const
  Overloaded != operator with a string.
bool  operator!= (const char *pStr) const
bool  operator!= (char *pStr) const
const FBString operator+= (const char *pStr)
  Overloaded += operator with a string.
FBString  operator+ (const char *pStr)
  Overloaded + operator with a string.
FBString  Mid (unsigned int pStart, unsigned int pLen) const
  Extracts a substring of length a specified length from a certain position.
FBString  Left (unsigned int pLen) const
  Extracts the first pLen caracters from this string.
FBString  Right (unsigned int pLen) const
  Extracts the last pLen caracters from this string.
unsigned int  GetLen () const
  Get the number of caracters in this string.
bool  IsEmpty () const
  This method determines whether the string is empty or not.
int  Find (char pCar) const
  Find first occurence of the specified caracter.
int  ReverseFind (char pCar) const
  Find last occurence of the specified caracter.

Friends

FBString  operator+ (const FBString &p1Str, const char *p2Str)

Constructor & Destructor Documentation

FBString::FBString ( )

Constructor.

FBString::FBString ( const char *  pStr )

Constructor from a string.

Parameters:
pStr String to copy.
FBString::FBString ( const FBString pStr )

Copy constructor.

Parameters:
pStr String to copy.
FBString::FBString ( const char *  p1Str,
const char *  p2Str 
)

Constructor from the concatenation of two strings.

Parameters:
p1Str First string to copy.
p2Str Second string to copy.
FBString::~FBString ( )

Destructor.


Member Function Documentation

FBString::operator char * ( ) const

Overloaded char* conversion operator.

FBString::operator const char * ( ) const
char FBString::operator[] ( unsigned int  pIndex ) const

Overloaded [] operator.

Parameters:
pIndex Index to read character from.
Returns:
Character at pIndex.
const FBString& FBString::operator= ( const char *  pStr )

Overloaded = operator with a string.

Parameters:
pStr String to copy (char*).
Returns:
Reference to this.
const FBString& FBString::operator= ( const FBString pStr )

Overloaded = operator with an FBString.

Parameters:
pStr String to copy (FBString).
Returns:
Reference to this.
bool FBString::operator== ( const FBString pStr ) const

Overloaded == operator with a string.

Parameters:
pStr String to compare with (char*).
Returns:
Outcome of comparison (true/false).
bool FBString::operator== ( const char *  pStr ) const
bool FBString::operator== ( char *  pStr ) const
bool FBString::operator!= ( const FBString pStr ) const

Overloaded != operator with a string.

Parameters:
pStr String to compare with (char*)
Returns:
Outcome of comparison (true/false).
bool FBString::operator!= ( const char *  pStr ) const
bool FBString::operator!= ( char *  pStr ) const
const FBString& FBString::operator+= ( const char *  pStr )

Overloaded += operator with a string.

Parameters:
pStr String to concatenate to this.
Returns:
Reference to this.
FBString FBString::operator+ ( const char *  pStr )

Overloaded + operator with a string.

Parameters:
pStr String to add.
Returns:
FBString of pStr concatenated to this.
FBString FBString::Mid ( unsigned int  pStart,
unsigned int  pLen 
) const

Extracts a substring of length a specified length from a certain position.

Parameters:
pStart Index of start.
pLen Number of caracter to extract.
FBString FBString::Left ( unsigned int  pLen ) const

Extracts the first pLen caracters from this string.

Parameters:
pLen Number of caracters to extract.
Returns:
FBString containing the first pLen caracters.
FBString FBString::Right ( unsigned int  pLen ) const

Extracts the last pLen caracters from this string.

Parameters:
pLen Number of caracters to extract.
Returns:
FBString containing the last pLen caracters.
unsigned int FBString::GetLen ( ) const

Get the number of caracters in this string.

Returns:
Number of caracters in this string, excluding the null-terminator.
bool FBString::IsEmpty ( ) const

This method determines whether the string is empty or not.

Returns:
true if string is empty, false otherwise.
int FBString::Find ( char  pCar ) const

Find first occurence of the specified caracter.

Parameters:
pCar Caracter to find in the string.
Returns:
Index of the caracter if found, -1 otherwise.
int FBString::ReverseFind ( char  pCar ) const

Find last occurence of the specified caracter.

Parameters:
pCar Caracter to find in the string.
Returns:
Index of the caracter if found, -1 otherwise.

Friends And Related Function Documentation

FBString operator+ ( const FBString p1Str,
const char *  p2Str 
) [friend]

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