FBX C++ API Reference
FbxString Class Reference

#include <fbxstring.h>

Class Description

Constructors and Destructor

 FbxString ()
 Default constructor. More...
 
 FbxString (const FbxString &pString)
 Copy constructor. More...
 
 FbxString (const char *pString)
 String constructor. More...
 
 FbxString (char pChar, size_t pNbRepeat=1)
 Character constructor. More...
 
 FbxString (const char *pCharPtr, size_t pLength)
 String constructor with maximum length. More...
 
 FbxString (const int pValue)
 Integer constructor. More...
 
 FbxString (const float pValue)
 Float constructor. More...
 
 FbxString (const double pValue)
 Double constructor. More...
 
 ~FbxString ()
 Destructor. More...
 

Buffer Access and Validation

size_t GetLen () const
 Get string length like "C" strlen(). More...
 
size_t Size () const
 Get string length like "C" strlen(). More...
 
bool IsEmpty () const
 Return true if string length equal zero. More...
 
FbxString & Clear ()
 Discard the content of the string. More...
 
char & operator[] (int pIndex)
 Access by reference. More...
 
char operator[] (int pIndex) const
 Access by copy. More...
 
char * Buffer ()
 Non-const buffer access. More...
 
const char * Buffer () const
 Const buffer access. More...
 

String Operations

const FbxString & operator= (const FbxString &pString)
 FbxString assignment operator. More...
 
const FbxString & operator= (char pChar)
 Character assignment operator. More...
 
const FbxString & operator= (const char *pString)
 String assignment operator. More...
 
const FbxString & operator= (int pValue)
 Int assignment operator. More...
 
const FbxString & operator= (float pValue)
 Float assignment operator. More...
 
const FbxString & operator= (double pValue)
 Double assignment operator. More...
 
const FbxString & operator+= (const FbxString &pString)
 FbxString append. More...
 
const FbxString & operator+= (char pChar)
 Character append. More...
 
const FbxString & operator+= (const char *pString)
 String append. More...
 
const FbxString & operator+= (int pValue)
 Integer append. More...
 
const FbxString & operator+= (float pValue)
 Float append. More...
 
const FbxString & operator+= (double pValue)
 Double append. More...
 
bool operator== (const FbxString &pString) const
 Equality operator. More...
 
bool operator!= (const FbxString &pString) const
 Inequality operator. More...
 
bool operator< (const FbxString &pString) const
 Inferior to operator. More...
 
bool operator<= (const FbxString &pString) const
 Inferior or equal to operator. More...
 
bool operator>= (const FbxString &pString) const
 Superior or equal to operator. More...
 
bool operator> (const FbxString &pString) const
 Superior to operator. More...
 
bool operator== (const char *pString) const
 Equality operator. More...
 
bool operator!= (const char *pString) const
 Inequality operator. More...
 
bool operator< (const char *pString) const
 Inferior to operator. More...
 
bool operator<= (const char *pString) const
 Inferior or equal to operator. More...
 
bool operator>= (const char *pString) const
 Superior or equal to operator. More...
 
bool operator> (const char *pString) const
 Superior to operator. More...
 
 operator const char * () const
 Cast operator. More...
 
const FbxString & Copy (const char *pString, size_t pLength)
 String assignment function with maximum length. More...
 
const FbxString & Append (const char *pString, size_t pLength)
 Append as "C" strncat(). More...
 
int Compare (const char *pString) const
 Compare as "C" strcmp(). More...
 
int CompareNoCase (const char *pString) const
 Compare as "C" stricmp(). More...
 
void Swap (FbxString &pString)
 Swap the contents of two strings. More...
 
FbxString Upper () const
 Uppercase conversion. More...
 
FbxString Lower () const
 Lowercase conversion. More...
 
FbxString operator+ (const FbxString &pString1, const FbxString &pString2)
 FbxString concatenation. More...
 
FbxString operator+ (const FbxString &pString, char pChar)
 Character concatenation. More...
 
FbxString operator+ (char pChar, const FbxString &pString)
 Character concatenation. More...
 
FbxString operator+ (const FbxString &pString1, const char *pString2)
 String concatenation. More...
 
FbxString operator+ (const char *pString1, const FbxString &pString2)
 String concatenation. More...
 
FbxString operator+ (const FbxString &pString, int pValue)
 Integer concatenation. More...
 
FbxString operator+ (int pValue, const FbxString &pString)
 Integer concatenation. More...
 
FbxString operator+ (const FbxString &pString, float pValue)
 Float concatenation. More...
 
FbxString operator+ (float pValue, const FbxString &pString)
 Float concatenation. More...
 
FbxString operator+ (const FbxString &pString, double pValue)
 Double concatenation. More...
 

Substring Extraction

FbxString Mid (size_t pFirst, size_t pCount) const
 Extract middle string for a given length. More...
 
FbxString Mid (size_t pFirst) const
 Extract middle string up to the end. More...
 
FbxString Left (size_t pCount) const
 Extract left string. More...
 
FbxString Right (size_t pCount) const
 Extract right string. More...
 

Padding

enum  EPaddingType { eRight, eLeft, eBoth }
 Padding types. More...
 
FbxString Pad (EPaddingType pPadding, size_t pLen, char pCar=' ') const
 Add padding characters. More...
 
FbxString UnPad (EPaddingType pPadding, char pCar='\0') const
 Remove padding characters. More...
 

Search

int Find (char pChar, size_t pStartPosition=0) const
 Look for a single character match, like "C" strchr(). More...
 
int Find (const char *pStrSub, size_t pStartPosition=0) const
 Look for a substring match, like "C" strstr(). More...
 
int ReverseFind (char pChar) const
 Look for the last occurrence of character in string, like "C" strrchr(). More...
 
int FindOneOf (const char *pStrCharSet, size_t pStartPosition=0) const
 Look for a single character match, like "C" strpbrk(). More...
 
bool FindAndReplace (const char *pFind, const char *pReplaceBy, size_t pStartPosition=0)
 Replace a substring. More...
 
bool ReplaceAll (const char *pFind, const char *pReplaceBy)
 Replace all occurrence of a substring. More...
 
bool ReplaceAll (char pFind, char pReplaceBy)
 Replace all occurrence of character to find by replacement character. More...
 

Token Extraction

int GetTokenCount (const char *pSpans) const
 Get number of tokens. More...
 
FbxString GetToken (int pTokenIndex, const char *pSpans) const
 Get token at given index. More...
 

Member Enumeration Documentation

◆ EPaddingType

Padding types.

  • eRight
  • eLeft
  • eBoth
Enumerator
eRight 
eLeft 
eBoth 

Definition at line 355 of file fbxstring.h.

Constructor & Destructor Documentation

◆ FbxString() [1/8]

FbxString ( )

Default constructor.

◆ FbxString() [2/8]

FbxString ( const FbxString &  pString)

Copy constructor.

Parameters
pStringThe FbxString to be copied.

◆ FbxString() [3/8]

FbxString ( const char *  pString)

String constructor.

Parameters
pStringThe string used to construct FbxString.

◆ FbxString() [4/8]

FbxString ( char  pChar,
size_t  pNbRepeat = 1 
)

Character constructor.

Parameters
pCharThe character used to construct FbxString.
pNbRepeatThe number of times to repeat the character. Default value is 1

◆ FbxString() [5/8]

FbxString ( const char *  pCharPtr,
size_t  pLength 
)

String constructor with maximum length.

Parameters
pCharPtrThe string used to construct FbxString.
pLengthMaximum length.

◆ FbxString() [6/8]

FbxString ( const int  pValue)

Integer constructor.

Parameters
pValueThe int value used to construct FbxString.

◆ FbxString() [7/8]

FbxString ( const float  pValue)

Float constructor.

Parameters
pValueThe float value used to construct FbxString.

◆ FbxString() [8/8]

FbxString ( const double  pValue)

Double constructor.

Parameters
pValueThe double value used to construct FbxString.

◆ ~FbxString()

~FbxString ( )

Destructor.

Member Function Documentation

◆ GetLen()

size_t GetLen ( ) const

Get string length like "C" strlen().

Examples:
ImportScene/DisplayAnimation.cxx, ImportScene/DisplayMesh.cxx, and ViewScene/SceneContext.cxx.

◆ Size()

size_t Size ( ) const

Get string length like "C" strlen().

◆ IsEmpty()

bool IsEmpty ( ) const

Return true if string length equal zero.

Examples:
ConvertScene/main.cxx, and ImportScene/DisplayLight.cxx.

◆ Clear()

FbxString& Clear ( )

Discard the content of the string.

◆ operator[]() [1/2]

char& operator[] ( int  pIndex)

Access by reference.

Parameters
pIndexThe index.
Returns
The reference of the char at pIndex.

◆ operator[]() [2/2]

char operator[] ( int  pIndex) const

Access by copy.

Parameters
pIndexThe index.
Returns
The char at pIndex.

◆ Buffer() [1/2]

◆ Buffer() [2/2]

const char* Buffer ( ) const

Const buffer access.

◆ operator=() [1/6]

const FbxString& operator= ( const FbxString &  pString)

FbxString assignment operator.

Parameters
pStringThe FbxString to be assigned.

◆ operator=() [2/6]

const FbxString& operator= ( char  pChar)

Character assignment operator.

Parameters
pCharThe character to be assigned.

◆ operator=() [3/6]

const FbxString& operator= ( const char *  pString)

String assignment operator.

Parameters
pStringThe string to be assigned.

◆ operator=() [4/6]

const FbxString& operator= ( int  pValue)

Int assignment operator.

Parameters
pValueThe int value to be assigned.

◆ operator=() [5/6]

const FbxString& operator= ( float  pValue)

Float assignment operator.

Parameters
pValueThe float value to be assigned.

◆ operator=() [6/6]

const FbxString& operator= ( double  pValue)

Double assignment operator.

Parameters
pValueThe double value to be assigned.

◆ operator+=() [1/6]

const FbxString& operator+= ( const FbxString &  pString)

FbxString append.

Parameters
pStringThe FbxString to be appended.

◆ operator+=() [2/6]

const FbxString& operator+= ( char  pChar)

Character append.

Parameters
pCharThe character to be appended.

◆ operator+=() [3/6]

const FbxString& operator+= ( const char *  pString)

String append.

Parameters
pStringThe string to be appended.

◆ operator+=() [4/6]

const FbxString& operator+= ( int  pValue)

Integer append.

Parameters
pValueThe int value to be appended.

◆ operator+=() [5/6]

const FbxString& operator+= ( float  pValue)

Float append.

Parameters
pValueThe float value to be appended.

◆ operator+=() [6/6]

const FbxString& operator+= ( double  pValue)

Double append.

Parameters
pValueThe double value to be appended.

◆ operator==() [1/2]

bool operator== ( const FbxString &  pString) const

Equality operator.

Parameters
pStringThe FbxString to be compared.

◆ operator!=() [1/2]

bool operator!= ( const FbxString &  pString) const

Inequality operator.

Parameters
pStringThe FbxString to be compared.

◆ operator<() [1/2]

bool operator< ( const FbxString &  pString) const

Inferior to operator.

Parameters
pStringThe FbxString to be compared.

◆ operator<=() [1/2]

bool operator<= ( const FbxString &  pString) const

Inferior or equal to operator.

Parameters
pStringThe FbxString to be compared.

◆ operator>=() [1/2]

bool operator>= ( const FbxString &  pString) const

Superior or equal to operator.

Parameters
pStringThe FbxString to be compared.

◆ operator>() [1/2]

bool operator> ( const FbxString &  pString) const

Superior to operator.

Parameters
pStringThe FbxString to be compared.

◆ operator==() [2/2]

bool operator== ( const char *  pString) const

Equality operator.

Parameters
pStringThe string to be compared.

◆ operator!=() [2/2]

bool operator!= ( const char *  pString) const

Inequality operator.

Parameters
pStringThe string to be compared.

◆ operator<() [2/2]

bool operator< ( const char *  pString) const

Inferior to operator.

Parameters
pStringThe string to be compared.

◆ operator<=() [2/2]

bool operator<= ( const char *  pString) const

Inferior or equal to operator.

Parameters
pStringThe string to be compared.

◆ operator>=() [2/2]

bool operator>= ( const char *  pString) const

Superior or equal to operator.

Parameters
pStringThe string to be compared.

◆ operator>() [2/2]

bool operator> ( const char *  pString) const

Superior to operator.

Parameters
pStringThe string to be compared.

◆ operator const char *()

operator const char * ( ) const

Cast operator.

◆ Copy()

const FbxString& Copy ( const char *  pString,
size_t  pLength 
)

String assignment function with maximum length.

Parameters
pStringThe string to be assigned.
pLengthThe maximum length of string to be assigned.

◆ Append()

const FbxString& Append ( const char *  pString,
size_t  pLength 
)

Append as "C" strncat().

Parameters
pStringThe string to be appended.
pLengthThe length of chars to be appended.

◆ Compare()

int Compare ( const char *  pString) const

Compare as "C" strcmp().

Parameters
pStringThe string to be compared.
Examples:
ViewScene/SetCamera.cxx.

◆ CompareNoCase()

int CompareNoCase ( const char *  pString) const

Compare as "C" stricmp().

Parameters
pStringThe string to be compared.

◆ Swap()

void Swap ( FbxString &  pString)

Swap the contents of two strings.

Parameters
pStringThe FbxString to be swapped.

◆ Upper()

FbxString Upper ( ) const

Uppercase conversion.

Examples:
ViewScene/SceneContext.cxx.

◆ Lower()

FbxString Lower ( ) const

Lowercase conversion.

◆ Mid() [1/2]

FbxString Mid ( size_t  pFirst,
size_t  pCount 
) const

Extract middle string for a given length.

Parameters
pFirstThe start index of FbxString to be extracted.
pCountThe length of sub-string to be extracted.

◆ Mid() [2/2]

FbxString Mid ( size_t  pFirst) const

Extract middle string up to the end.

Parameters
pFirstThe start index of FbxString to be extracted.

◆ Left()

FbxString Left ( size_t  pCount) const

Extract left string.

Parameters
pCountThe length of sub-string to be extracted.
Examples:
ImportScene/DisplayCamera.cxx, and ImportScene/DisplayMesh.cxx.

◆ Right()

FbxString Right ( size_t  pCount) const

Extract right string.

Parameters
pCountThe length of sub-string to be extracted.
Examples:
ViewScene/SceneContext.cxx.

◆ Pad()

FbxString Pad ( EPaddingType  pPadding,
size_t  pLen,
char  pCar = ' ' 
) const

Add padding characters.

Parameters
pPaddingThe padding type.
pLenThe length limit of FbxString after padding.
pCarThe character to be padded.

◆ UnPad()

FbxString UnPad ( EPaddingType  pPadding,
char  pCar = '\0' 
) const

Remove padding characters.

Parameters
pPaddingThe padding type.
pCarThe character to be padded.
Remarks
If pCar == '\0' the function will remove all the characters that are tested by isspace().

◆ Find() [1/2]

int Find ( char  pChar,
size_t  pStartPosition = 0 
) const

Look for a single character match, like "C" strchr().

Parameters
pCharThe character to look for.
pStartPositionStart position to look for.
Returns
Index or -1 if not found.
Examples:
Common/Common.cxx, and ExportDocument/main.cxx.

◆ Find() [2/2]

int Find ( const char *  pStrSub,
size_t  pStartPosition = 0 
) const

Look for a substring match, like "C" strstr().

Parameters
pStrSubThe substring to look for.
pStartPositionStart position to look for.
Returns
Starting index or -1 if not found.

◆ ReverseFind()

int ReverseFind ( char  pChar) const

Look for the last occurrence of character in string, like "C" strrchr().

Parameters
pCharThe character to look for.
Returns
Index or -1 if not found.

◆ FindOneOf()

int FindOneOf ( const char *  pStrCharSet,
size_t  pStartPosition = 0 
) const

Look for a single character match, like "C" strpbrk().

Parameters
pStrCharSetThe character set.
pStartPositionThe start position.
Returns
Index or -1 if not found.

◆ FindAndReplace()

bool FindAndReplace ( const char *  pFind,
const char *  pReplaceBy,
size_t  pStartPosition = 0 
)

Replace a substring.

Parameters
pFindThe substring to look for.
pReplaceByThe string to replace by.
pStartPositionThe start position.
Returns
true if substring found and replaced.

◆ ReplaceAll() [1/2]

bool ReplaceAll ( const char *  pFind,
const char *  pReplaceBy 
)

Replace all occurrence of a substring.

Parameters
pFindThe substring to look for.
pReplaceByThe string to replace by.
Returns
true if something got replaced.

◆ ReplaceAll() [2/2]

bool ReplaceAll ( char  pFind,
char  pReplaceBy 
)

Replace all occurrence of character to find by replacement character.

Parameters
pFindThe character to look for.
pReplaceByThe character to replace by.
Returns
true if character found and replaced.

◆ GetTokenCount()

int GetTokenCount ( const char *  pSpans) const

Get number of tokens.

Parameters
pSpansThe span
Returns
The number of tokens.
Examples:
MyOwnWriterReader/MyOwnReader.cxx.

◆ GetToken()

FbxString GetToken ( int  pTokenIndex,
const char *  pSpans 
) const

Get token at given index.

Parameters
pTokenIndexThe token index.
pSpansThe span
Examples:
MyOwnWriterReader/MyOwnReader.cxx.

Friends And Related Function Documentation

◆ operator+ [1/10]

FbxString operator+ ( const FbxString &  pString1,
const FbxString &  pString2 
)
friend

FbxString concatenation.

Parameters
pString1FbxString 1 to be concatenated to FbxString 2.
pString2FbxString 2 to be concatenated to FbxString 1

◆ operator+ [2/10]

FbxString operator+ ( const FbxString &  pString,
char  pChar 
)
friend

Character concatenation.

Parameters
pStringFbxString to be concatenated to Character.
pCharCharacter to be concatenated to FbxString

◆ operator+ [3/10]

FbxString operator+ ( char  pChar,
const FbxString &  pString 
)
friend

Character concatenation.

Parameters
pCharCharacter to be concatenated to FbxString
pStringFbxString to be concatenated to Character.

◆ operator+ [4/10]

FbxString operator+ ( const FbxString &  pString1,
const char *  pString2 
)
friend

String concatenation.

Parameters
pString1FbxString to be concatenated to String.
pString2String to be concatenated to FbxString

◆ operator+ [5/10]

FbxString operator+ ( const char *  pString1,
const FbxString &  pString2 
)
friend

String concatenation.

Parameters
pString1String to be concatenated to FbxString
pString2FbxString to be concatenated to String.

◆ operator+ [6/10]

FbxString operator+ ( const FbxString &  pString,
int  pValue 
)
friend

Integer concatenation.

Parameters
pStringFbxString to be concatenated to Integer.
pValueInteger to be concatenated to FbxString

◆ operator+ [7/10]

FbxString operator+ ( int  pValue,
const FbxString &  pString 
)
friend

Integer concatenation.

Parameters
pValueInteger to be concatenated to FbxString
pStringFbxString to be concatenated to Integer.

◆ operator+ [8/10]

FbxString operator+ ( const FbxString &  pString,
float  pValue 
)
friend

Float concatenation.

Parameters
pStringFbxString to be concatenated to Float.
pValueFloat to be concatenated to FbxString

◆ operator+ [9/10]

FbxString operator+ ( float  pValue,
const FbxString &  pString 
)
friend

Float concatenation.

Parameters
pValueFloat to be concatenated to FbxString
pStringFbxString to be concatenated to Float.

◆ operator+ [10/10]

FbxString operator+ ( const FbxString &  pString,
double  pValue 
)
friend

Double concatenation.

Parameters
pStringFbxString to be concatenated to Double.
pValueDouble to be concatenated to FbxString

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