Open Reality Reference Guide
 
Loading...
Searching...
No Matches
FBString Class Reference

Basic string class. More...

#include <fbstring.h>

Public Member Functions

 FBString ()=default
 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 FBStringoperator= (const char *pStr)
 Overloaded = operator with a string.
 
const FBStringoperator= (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 FBStringoperator+= (const char pChr)
 Overloaded += operator with a char.
 
const FBStringoperator+= (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 characters from this string.
 
FBString Right (unsigned int pLen) const
 Extracts the last pLen characters from this string.
 
unsigned int GetLen () const
 Get the number of characters in this string.
 
bool IsEmpty () const
 This method determines whether the string is empty or not.
 
int Find (char pCar) const
 Find first occurrence of the specified character.
 
int ReverseFind (char pCar) const
 Find last occurrence of the specified character.
 

Detailed Description

Basic string class.

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

Definition at line 66 of file fbstring.h.

Constructor & Destructor Documentation

◆ FBString() [1/4]

FBString ( )
default

Constructor.

◆ FBString() [2/4]

FBString ( const char *  pStr)

Constructor from a string.

Parameters
pStrString to copy.

◆ FBString() [3/4]

FBString ( const FBString pStr)

Copy constructor.

Parameters
pStrString to copy.

◆ FBString() [4/4]

FBString ( const char *  p1Str,
const char *  p2Str 
)

Constructor from the concatenation of two strings.

Parameters
p1StrFirst string to copy.
p2StrSecond string to copy.

◆ ~FBString()

~FBString ( )

Destructor.

Member Function Documentation

◆ Find()

int Find ( char  pCar) const

Find first occurrence of the specified character.

Parameters
pCarCharacter to find in the string.
Returns
Index of the character if found, -1 otherwise.

◆ GetLen()

unsigned int GetLen ( ) const

Get the number of characters in this string.

Returns
Number of characters in this string, excluding the null-terminator.

◆ IsEmpty()

bool IsEmpty ( ) const

This method determines whether the string is empty or not.

Returns
true if string is empty, false otherwise.

◆ Left()

FBString Left ( unsigned int  pLen) const

Extracts the first pLen characters from this string.

Parameters
pLenNumber of characters to extract.
Returns
FBString containing the first pLen characters.

◆ Mid()

FBString Mid ( unsigned int  pStart,
unsigned int  pLen 
) const

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

Parameters
pStartIndex of start.
pLenNumber of character to extract.

◆ operator char *()

operator char * ( ) const

Overloaded char* conversion operator.

◆ operator!=()

bool operator!= ( const FBString pStr) const

Overloaded != operator with a string.

Parameters
pStrString to compare with (char*)
Returns
Outcome of comparison (true/false).

◆ operator+()

FBString operator+ ( const char *  pStr)

Overloaded + operator with a string.

Parameters
pStrString to add.
Returns
FBString of pStr concatenated to this.

◆ operator+=() [1/2]

const FBString & operator+= ( const char *  pStr)

Overloaded += operator with a string.

Parameters
pStrString to concatenate to this.
Returns
Reference to this.

◆ operator+=() [2/2]

const FBString & operator+= ( const char  pChr)

Overloaded += operator with a char.

Parameters
pChrChar to concatenate to this.
Returns
Reference to this.

◆ operator=() [1/2]

const FBString & operator= ( const char *  pStr)

Overloaded = operator with a string.

Parameters
pStrString to copy (char*).
Returns
Reference to this.

◆ operator=() [2/2]

const FBString & operator= ( const FBString pStr)

Overloaded = operator with an FBString.

Parameters
pStrString to copy (FBString).
Returns
Reference to this.

◆ operator==()

bool operator== ( const FBString pStr) const

Overloaded == operator with a string.

Parameters
pStrString to compare with (char*).
Returns
Outcome of comparison (true/false).

◆ operator[]()

char operator[] ( unsigned int  pIndex) const

Overloaded [] operator.

Parameters
pIndexIndex to read character from.
Returns
Character at pIndex.

◆ ReverseFind()

int ReverseFind ( char  pCar) const

Find last occurrence of the specified character.

Parameters
pCarCharacter to find in the string.
Returns
Index of the character if found, -1 otherwise.

◆ Right()

FBString Right ( unsigned int  pLen) const

Extracts the last pLen characters from this string.

Parameters
pLenNumber of characters to extract.
Returns
FBString containing the last pLen characters.

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