CFX_ByteString Class Reference

BYTE STRING CLASS. More...

Inherits CFX_Object.

Public Member Functions

 CFX_ByteString ()
 Construct a null byte string.
 
 CFX_ByteString (const CFX_ByteString &str)
 Copy constructor. More...
 
 CFX_ByteString (char ch)
 Construct from a single character. More...
 
 CFX_ByteString (FX_LPCSTR ptr, FX_STRSIZE len=-1)
 Construct from a character string. More...
 
 CFX_ByteString (FX_LPCBYTE ptr, FX_STRSIZE len)
 Construct from a byte string. More...
 
 CFX_ByteString (FX_BSTR bstrc)
 Construct from a constant ref to a CFX_ByteStringC object. More...
 
 CFX_ByteString (FX_BSTR bstrc1, FX_BSTR bstrc2)
 Concatenate constructor. More...
 
 ~CFX_ByteString ()
 
int Compare (FX_BSTR str) const
 Compare the the string with another. Case-sensitive. More...
 
void ConvertFrom (const CFX_WideString &str, CFX_CharMap *pCharMap=NULL)
 Load unicode data into this byte string, using specified character mapper. If no character mapper specified, the system default mapper will be used. More...
 
FX_STRSIZE Delete (FX_STRSIZE index, FX_STRSIZE count=1)
 Delete one or more characters starting from specific position. More...
 
void Empty ()
 Set this string to be empty. More...
 
bool Equal (FX_BSTR str) const
 Check if current string is equal to another one. Case-sensitive. More...
 
bool EqualNoCase (FX_BSTR str) const
 Check if current string is equal to another one, not considering case. More...
 
FX_STRSIZE Find (FX_BSTR lpszSub, FX_STRSIZE start=0) const
 Find a sub-string, from specific position. Only first occurrence is found. More...
 
FX_STRSIZE Find (FX_CHAR ch, FX_STRSIZE start=0) const
 Find a character, from specific position. Only first occurrence is found. More...
 
void Format (FX_LPCSTR lpszFormat,...)
 Format a number of parameters into this byte string. More...
 
void FormatV (FX_LPCSTR lpszFormat, va_list argList)
 Format a number of parameters into this byte string, using va_list. More...
 
FX_BYTE GetAt (FX_STRSIZE nIndex) const
 Get a single byte specified by an index number. More...
 
FX_LPSTR GetBuffer (FX_STRSIZE len)
 Get a buffer with specific number of bytes allocated. More...
 
FX_DWORD GetID (FX_STRSIZE start_pos=0) const
 Get a DWORD identifier of the string. See function CFX_ByteStringC::GetID for details. More...
 
FX_STRSIZE GetLength () const
 Get number of bytes in the byte string (not counting any possible terminator). More...
 
FX_STRSIZE Insert (FX_STRSIZE index, FX_CHAR ch)
 Insert a character before specific position. More...
 
bool IsEmpty () const
 Check whether current string object is empty. More...
 
CFX_ByteString Left (FX_STRSIZE count) const
 Extracts the first (leftmost) count bytes from this CFX_ByteString object as a sub-string. More...
 
void Load (FX_LPCBYTE str, FX_STRSIZE len)
 Load from a byte string. More...
 
FX_LPSTR LockBuffer ()
 Lock and get the current string buffer, so the caller can modify the returned buffer. More...
 
void MakeLower ()
 Change case of English letters to lower. More...
 
void MakeUpper ()
 Change case of English letters to upper. More...
 
CFX_ByteString Mid (FX_STRSIZE first) const
 Extracts a substring from this CFX_ByteString object, starting at position nFirst (zero-based) to last. More...
 
CFX_ByteString Mid (FX_STRSIZE first, FX_STRSIZE count) const
 Extracts a substring of count bytes from this CFX_ByteString object, starting at position nFirst (zero-based) to last. More...
 
 operator FX_LPCBYTE () const
 FX_LPCBYTE type conversion operator. CFX_ByteString can be used in places where FX_LPCSTR or FX_LPCBYTE is needed.
 
 operator FX_LPCSTR () const
 FX_LPCSTR type conversion operator. CFX_ByteString can be used in places where FX_LPCSTR or FX_LPCBYTE is needed.
 
bool operator!= (FX_LPCSTR str) const
 Comparison(!=) operator overload. case-sensitive. More...
 
bool operator!= (FX_BSTR str) const
 Comparison(!=) operator overload. case-sensitive. More...
 
bool operator!= (const CFX_ByteString &str) const
 Comparison(!=) operator overload. case-sensitive. More...
 
const CFX_ByteStringoperator+= (FX_CHAR ch)
 Concatenation(+=) operator overload. Concatenate a single character. More...
 
const CFX_ByteStringoperator+= (FX_LPCSTR str)
 Concatenation(+=) operator overload. Concatenate a null-terminated character string. More...
 
const CFX_ByteStringoperator+= (const CFX_ByteString &str)
 Concatenation(+=) operator overload. Concatenate a CFX_ByteString object. More...
 
const CFX_ByteStringoperator+= (FX_BSTR bstrc)
 Concatenation(+=) operator overload. Concatenate a constant CFX_ByteStringC object. More...
 
bool operator< (const CFX_ByteString &rhs) const
 Comparison(<) operator overload. case-sensitive. More...
 
const CFX_ByteStringoperator= (FX_LPCSTR str)
 Assignment(=) operator overload. From a character string. More...
 
const CFX_ByteStringoperator= (FX_BSTR bstrc)
 Assignment(=) operator overload. From a constant byte string. More...
 
const CFX_ByteStringoperator= (const CFX_ByteString &stringSrc)
 Assignment(=) operator overload. From a CFX_ByteString object. More...
 
const CFX_ByteStringoperator= (const CFX_BinaryBuf &buf)
 Assignment(=) operator overload. From a CFX_BinaryBuf object. More...
 
bool operator== (FX_LPCSTR str) const
 Comparison(==) operator overload. case-sensitive. More...
 
bool operator== (FX_BSTR str) const
 Comparison(==) operator overload. case-sensitive. More...
 
bool operator== (const CFX_ByteString &str) const
 Comparison(==) operator overload. case-sensitive. More...
 
FX_BYTE operator[] (FX_STRSIZE nIndex) const
 Subscript([]) operator overload. It retrieves a single byte specified by the zero-based index in nIndex. More...
 
void ReleaseBuffer (FX_STRSIZE len=-1)
 Release the buffer fetched by function CFX_ByteString::GetBuffer or CFX_ByteString::LockBuffer, and set the length of modified string. More...
 
FX_STRSIZE Remove (FX_CHAR ch)
 Remove all occurrence of a particular character. More...
 
FX_STRSIZE Replace (FX_BSTR lpszOld, FX_BSTR lpszNew)
 Replace all patterns in the string with a new sub-string. More...
 
void Reserve (FX_STRSIZE len)
 Reserve a buffer that can hold specific number of bytes. More...
 
FX_STRSIZE ReverseFind (FX_CHAR ch) const
 Find a character from end of the string. More...
 
CFX_ByteString Right (FX_STRSIZE count) const
 Extracts the last (rightmost) count bytes from this CFX_ByteString object as a sub-string. More...
 
void SetAt (FX_STRSIZE nIndex, FX_CHAR ch)
 Overwrites a single byte specified by an index number. More...
 
void TrimLeft ()
 Trim white spaces from the left side of the byte string. More...
 
void TrimLeft (FX_CHAR chTarget)
 Trim continuous occurrences of specified characters from left side of the byte string. More...
 
void TrimLeft (FX_BSTR lpszTargets)
 Trim continuous occurrences of specified characters from left side of the byte string. More...
 
void TrimRight ()
 Trim white spaces from the right side of the byte string. More...
 
void TrimRight (FX_CHAR chTarget)
 Trim continuous occurrences of specified character from right side of the byte string. More...
 
void TrimRight (FX_BSTR lpszTargets)
 Trim continuous occurrences of specified characters from right side of the byte string. More...
 
CFX_WideString UTF8Decode () const
 Decode a UTF-8 unicode string (assume this byte string is UTF-8 encoded). More...
 

Static Public Member Functions

static CFX_ByteString FormatFloat (FX_FLOAT f, int precision=0)
 Convert from floating-point number. More...
 
static CFX_ByteString FormatInteger (FX_INT32 i, FX_DWORD flags=0)
 Convert from Integer. More...
 
static CFX_ByteString FromUnicode (FX_LPCWSTR ptr, FX_STRSIZE len=-1)
 Create a CFX_ByteString object from a Unicode string. Convert from Unicode to system multi-byte charset. More...
 
static CFX_ByteString FromUnicode (const CFX_WideString &str)
 Create a CFX_ByteString object from a CFX_WideString object. More...
 
static CFX_ByteString LoadFromFile (FX_BSTR file_path)
 Load the whole content of a file. More...
 

Detailed Description

BYTE STRING CLASS.

Constructor & Destructor Documentation

◆ CFX_ByteString() [1/6]

CFX_ByteString::CFX_ByteString ( const CFX_ByteString str)

Copy constructor.

Parameters
[in]strA constant ref to a CFX_ByteString object.

◆ CFX_ByteString() [2/6]

CFX_ByteString::CFX_ByteString ( char  ch)
explicit

Construct from a single character.

Parameters
[in]chA single character.

◆ CFX_ByteString() [3/6]

CFX_ByteString::CFX_ByteString ( FX_LPCSTR  ptr,
FX_STRSIZE  len = -1 
)

Construct from a character string.

Parameters
[in]ptrPointer to a constant character string.
[in]lenThe length of the character string. len can be -1 for zero terminated string.

◆ CFX_ByteString() [4/6]

CFX_ByteString::CFX_ByteString ( FX_LPCBYTE  ptr,
FX_STRSIZE  len 
)

Construct from a byte string.

Parameters
[in]ptrPointer to a constant byte string.
[in]lenThe length of the byte string.

◆ CFX_ByteString() [5/6]

CFX_ByteString::CFX_ByteString ( FX_BSTR  bstrc)

Construct from a constant ref to a CFX_ByteStringC object.

Parameters
[in]bstrcA constant ref to a CFX_ByteStringC object.

◆ CFX_ByteString() [6/6]

CFX_ByteString::CFX_ByteString ( FX_BSTR  bstrc1,
FX_BSTR  bstrc2 
)

Concatenate constructor.

Parameters
[in]bstrc1Fist constant ref to a CFX_ByteStringC object.
[in]bstrc2Second constant ref to a CFX_ByteStringC object.

◆ ~CFX_ByteString()

CFX_ByteString::~CFX_ByteString ( )

Destructor.

Member Function Documentation

◆ Compare()

int CFX_ByteString::Compare ( FX_BSTR  str) const

Compare the the string with another. Case-sensitive.

Parameters
[in]strThe byte string to be compared.
Returns
  • -1 means current string is "smaller" (in alphabetic order) than the other one.
  • 0 means equal.
  • 1 means current string is "larger" (in alphabetic order) than the other one.

◆ ConvertFrom()

void CFX_ByteString::ConvertFrom ( const CFX_WideString str,
CFX_CharMap pCharMap = NULL 
)

Load unicode data into this byte string, using specified character mapper. If no character mapper specified, the system default mapper will be used.

Parameters
[in]strThe input unicode string.
[in]pCharMapSpecified character mapper to be used for converting.
Returns
None.

◆ Delete()

FX_STRSIZE CFX_ByteString::Delete ( FX_STRSIZE  index,
FX_STRSIZE  count = 1 
)

Delete one or more characters starting from specific position.

Parameters
[in]indexSpecifies the zero-based index in the byte string for starting deleting.
[in]countCount of bytes to be deleted.
Returns
The new length of the byte string.

◆ Empty()

void CFX_ByteString::Empty ( )

Set this string to be empty.

Returns
None.

◆ Equal()

bool CFX_ByteString::Equal ( FX_BSTR  str) const

Check if current string is equal to another one. Case-sensitive.

This function is faster than function CFX_ByteString::Compare if only need to check whether two strings are equal.

Parameters
[in]strThe byte string to be compared.
Returns
true means current string is equal to the other one, while false means not.

◆ EqualNoCase()

bool CFX_ByteString::EqualNoCase ( FX_BSTR  str) const

Check if current string is equal to another one, not considering case.

This function will treat letters 'A'-'Z' just same as 'a'-'z'.

Parameters
[in]strThe byte string to be compared.
Returns
true means current string is equal to the other one, while false means not.

◆ Find() [1/2]

FX_STRSIZE CFX_ByteString::Find ( FX_BSTR  lpszSub,
FX_STRSIZE  start = 0 
) const

Find a sub-string, from specific position. Only first occurrence is found.

Parameters
[in]lpszSubThe sub-string to be found.
[in]startSpecifies the zero-based index of the starting position to do finding.
Return values
Theposition where first occurrence is found. -1 means not found.

◆ Find() [2/2]

FX_STRSIZE CFX_ByteString::Find ( FX_CHAR  ch,
FX_STRSIZE  start = 0 
) const

Find a character, from specific position. Only first occurrence is found.

Parameters
[in]chThe character to be found.
[in]startSpecifies the zero-based index of the starting position to do finding.
Return values
Theposition where first occurrence is found. -1 means not found.

◆ Format()

void CFX_ByteString::Format ( FX_LPCSTR  lpszFormat,
  ... 
)

Format a number of parameters into this byte string.

On desktop platforms, this function supports all the sprintf() formats.
On embedded platforms, it supports only a subset of formats:

  • Supported types: d, u, f, g, x, X, s, c, %.
  • Width field supported.
  • Precision not supported
  • Flags supported: '0'.
Parameters
[in]lpszFormatSpecifies a format-control string.
Returns
None.

◆ FormatFloat()

static CFX_ByteString CFX_ByteString::FormatFloat ( FX_FLOAT  f,
int  precision = 0 
)
static

Convert from floating-point number.

Parameters
[in]fThe input floating-point number.
[in]precisionThe number of decimal digits. Not used. Default value: 0.
Returns
A CFX_ByteString object.

◆ FormatInteger()

static CFX_ByteString CFX_ByteString::FormatInteger ( FX_INT32  i,
FX_DWORD  flags = 0 
)
static

Convert from Integer.

The flags can be following flags (single or compound):

  • FXFORMAT_SIGNED
  • FXFORMAT_HEX
  • FXFORMAT_CAPITAL
Parameters
[in]iThe input 32-bit integer.
[in]flagsThe formating flags. Default value: 0.
Returns
A CFX_ByteString object.

◆ FormatV()

void CFX_ByteString::FormatV ( FX_LPCSTR  lpszFormat,
va_list  argList 
)

Format a number of parameters into this byte string, using va_list.

Parameters
[in]lpszFormatSpecifies a format-control string.
[in]argListVariable-argument lists.
Returns
None.
See also
CFX_ByteString::Format

◆ FromUnicode() [1/2]

static CFX_ByteString CFX_ByteString::FromUnicode ( FX_LPCWSTR  ptr,
FX_STRSIZE  len = -1 
)
static

Create a CFX_ByteString object from a Unicode string. Convert from Unicode to system multi-byte charset.

Parameters
[in]ptrPointer to a constant Unicode string.
[in]lenThe length of the Unicode string. len can be -1 for zero terminated Unicode string.
Returns
A byte string.

◆ FromUnicode() [2/2]

static CFX_ByteString CFX_ByteString::FromUnicode ( const CFX_WideString str)
static

Create a CFX_ByteString object from a CFX_WideString object.

Parameters
[in]strA ref to a constant CFX_WideString object.
Returns
A byte string.

◆ GetAt()

FX_BYTE CFX_ByteString::GetAt ( FX_STRSIZE  nIndex) const
inline

Get a single byte specified by an index number.

Parameters
[in]nIndexSpecifies the zero-based index in the byte string.
Returns
A single byte.

◆ GetBuffer()

FX_LPSTR CFX_ByteString::GetBuffer ( FX_STRSIZE  len)

Get a buffer with specific number of bytes allocated.

The content of this string won't be affected by function CFX_ByteString::GetBuffer. Caller can modified the returned buffer, and should call function CFX_ByteString::ReleaseBuffer after modification done.

Parameters
[in]lenthe Length expected to get.
Returns
A character string pointer to the byte string.

◆ GetID()

FX_DWORD CFX_ByteString::GetID ( FX_STRSIZE  start_pos = 0) const

Get a DWORD identifier of the string. See function CFX_ByteStringC::GetID for details.

Parameters
[in]start_posStart position in the constant byte string.
Returns
A FX_DWORD identifier.

◆ GetLength()

FX_STRSIZE CFX_ByteString::GetLength ( ) const
inline

Get number of bytes in the byte string (not counting any possible terminator).

Returns
The Length of the byte string.

◆ Insert()

FX_STRSIZE CFX_ByteString::Insert ( FX_STRSIZE  index,
FX_CHAR  ch 
)

Insert a character before specific position.

Parameters
[in]indexSpecifies the zero-based index in the byte string.
[in]chA single character.
Returns
The new length of the byte string.

◆ IsEmpty()

bool CFX_ByteString::IsEmpty ( ) const
inline

Check whether current string object is empty.

Returns
true means current string object is empty, while false means not.

◆ Left()

CFX_ByteString CFX_ByteString::Left ( FX_STRSIZE  count) const

Extracts the first (leftmost) count bytes from this CFX_ByteString object as a sub-string.

Parameters
[in]countThe count of bytes expected to extract for the sub-string.
Returns
A CFX_ByteString sub-string.

◆ Load()

void CFX_ByteString::Load ( FX_LPCBYTE  str,
FX_STRSIZE  len 
)

Load from a byte string.

Parameters
[in]strPointer to a constant byte string.
[in]lenThe length of the byte string.
Returns
None.

◆ LoadFromFile()

static CFX_ByteString CFX_ByteString::LoadFromFile ( FX_BSTR  file_path)
static

Load the whole content of a file.

Parameters
[in]file_pathThe file path.
Returns
A CFX_ByteString object.

◆ LockBuffer()

FX_LPSTR CFX_ByteString::LockBuffer ( )

Lock and get the current string buffer, so the caller can modify the returned buffer.

Caller can modified the returned buffer, and should call function CFX_ByteString::ReleaseBuffer after modification done.

Returns
A character string pointer to the byte string.

◆ MakeLower()

void CFX_ByteString::MakeLower ( )

Change case of English letters to lower.

Returns
None.

◆ MakeUpper()

void CFX_ByteString::MakeUpper ( )

Change case of English letters to upper.

Returns
None.

◆ Mid() [1/2]

CFX_ByteString CFX_ByteString::Mid ( FX_STRSIZE  first) const

Extracts a substring from this CFX_ByteString object, starting at position nFirst (zero-based) to last.

Parameters
[in]firstSpecifies the zero-based index of the starting position in this CFX_ByteString object.
Returns
A CFX_ByteString sub-string.

◆ Mid() [2/2]

CFX_ByteString CFX_ByteString::Mid ( FX_STRSIZE  first,
FX_STRSIZE  count 
) const

Extracts a substring of count bytes from this CFX_ByteString object, starting at position nFirst (zero-based) to last.

Parameters
[in]firstSpecifies the zero-based index of the starting position in this CFX_ByteString object.
[in]countThe count of bytes expected to extract for the sub-string.
Returns
A CFX_ByteString sub-string.

◆ operator!=() [1/3]

bool CFX_ByteString::operator!= ( FX_LPCSTR  str) const
inline

Comparison(!=) operator overload. case-sensitive.

Parameters
[in]strThe null-terminated character string to be compared.
Returns
true means not equal, while false means equal.

◆ operator!=() [2/3]

bool CFX_ByteString::operator!= ( FX_BSTR  str) const
inline

Comparison(!=) operator overload. case-sensitive.

Parameters
[in]strThe null-terminated constant byte string to be compared.
Returns
true means not equal, while false means equal.

◆ operator!=() [3/3]

bool CFX_ByteString::operator!= ( const CFX_ByteString str) const
inline

Comparison(!=) operator overload. case-sensitive.

Parameters
[in]strThe null-terminated byte string to be compared.
Returns
true means not equal, while false means equal.

◆ operator+=() [1/4]

const CFX_ByteString& CFX_ByteString::operator+= ( FX_CHAR  ch)

Concatenation(+=) operator overload. Concatenate a single character.

Parameters
[in]chA single character.
Returns
A reference to current object itself.

◆ operator+=() [2/4]

const CFX_ByteString& CFX_ByteString::operator+= ( FX_LPCSTR  str)

Concatenation(+=) operator overload. Concatenate a null-terminated character string.

Parameters
[in]strPointer to a constant null-terminated character string.
Returns
A reference to current object itself.

◆ operator+=() [3/4]

const CFX_ByteString& CFX_ByteString::operator+= ( const CFX_ByteString str)

Concatenation(+=) operator overload. Concatenate a CFX_ByteString object.

Parameters
[in]strA ref to a constant CFX_ByteString object.
Returns
A reference to current object itself.

◆ operator+=() [4/4]

const CFX_ByteString& CFX_ByteString::operator+= ( FX_BSTR  bstrc)

Concatenation(+=) operator overload. Concatenate a constant CFX_ByteStringC object.

Parameters
[in]bstrcA ref to a constant CFX_ByteStringC object.
Returns
A reference to current object itself.

◆ operator<()

bool CFX_ByteString::operator< ( const CFX_ByteString rhs) const

Comparison(<) operator overload. case-sensitive.

Parameters
[in]rhsThe right hand side string.
Returns
true means current string is smaller than parameter rhs, while false means not.

◆ operator=() [1/4]

const CFX_ByteString& CFX_ByteString::operator= ( FX_LPCSTR  str)

Assignment(=) operator overload. From a character string.

Parameters
[in]strA pointer to a constant character string.
Returns
A reference to current object itself.

◆ operator=() [2/4]

const CFX_ByteString& CFX_ByteString::operator= ( FX_BSTR  bstrc)

Assignment(=) operator overload. From a constant byte string.

Parameters
[in]bstrcA ref to a constant byte string.
Returns
A reference to current object itself.

◆ operator=() [3/4]

const CFX_ByteString& CFX_ByteString::operator= ( const CFX_ByteString stringSrc)

Assignment(=) operator overload. From a CFX_ByteString object.

Parameters
[in]stringSrcA ref to a constant CFX_ByteString object.
Returns
A reference to current object itself.

◆ operator=() [4/4]

const CFX_ByteString& CFX_ByteString::operator= ( const CFX_BinaryBuf buf)

Assignment(=) operator overload. From a CFX_BinaryBuf object.

Parameters
[in]bufA ref to a constant CFX_BinaryBuf object.
Returns
A reference to current object itself.

◆ operator==() [1/3]

bool CFX_ByteString::operator== ( FX_LPCSTR  str) const
inline

Comparison(==) operator overload. case-sensitive.

Parameters
[in]strThe null-terminated character string to be compared.
Returns
true means equal, while false means not equal.

◆ operator==() [2/3]

bool CFX_ByteString::operator== ( FX_BSTR  str) const
inline

Comparison(==) operator overload. case-sensitive.

Parameters
[in]strThe null-terminated constant byte string to be compared.
Returns
true means equal, while false means not equal.

◆ operator==() [3/3]

bool CFX_ByteString::operator== ( const CFX_ByteString str) const

Comparison(==) operator overload. case-sensitive.

Parameters
[in]strThe null-terminated byte string to be compared.
Returns
true means equal, while false means not equal.

◆ operator[]()

FX_BYTE CFX_ByteString::operator[] ( FX_STRSIZE  nIndex) const
inline

Subscript([]) operator overload. It retrieves a single byte specified by the zero-based index in nIndex.

Parameters
[in]nIndexSpecifies the zero-based index in the byte string.
Returns
A single byte.

◆ ReleaseBuffer()

void CFX_ByteString::ReleaseBuffer ( FX_STRSIZE  len = -1)

Release the buffer fetched by function CFX_ByteString::GetBuffer or CFX_ByteString::LockBuffer, and set the length of modified string.

If parameter len parameter is -1, then it's assumed to be a zero-terminated string.

Parameters
[in]lenLength expected to release to. Default value: -1.
Returns
None.

◆ Remove()

FX_STRSIZE CFX_ByteString::Remove ( FX_CHAR  ch)

Remove all occurrence of a particular character.

Parameters
[in]chSpecified the character to be removed.
Returns
The number of characters removed.

◆ Replace()

FX_STRSIZE CFX_ByteString::Replace ( FX_BSTR  lpszOld,
FX_BSTR  lpszNew 
)

Replace all patterns in the string with a new sub-string.

Parameters
[in]lpszOldSpecified the string to be matched and replaced in the byte string.
[in]lpszNewSpecified the string to replace.
Returns
The number of replaced patterns.

◆ Reserve()

void CFX_ByteString::Reserve ( FX_STRSIZE  len)

Reserve a buffer that can hold specific number of bytes.

The content of this string won't be changed. This can be used if application anticipates the string may grow many times, in this case, reserving a larger buffer will support string growth without buffer reallocation.

Parameters
[in]lenLength expected to reserve.
Returns
None.

◆ ReverseFind()

FX_STRSIZE CFX_ByteString::ReverseFind ( FX_CHAR  ch) const

Find a character from end of the string.

Parameters
[in]chA character to be found in curren string, from the end.
Returns
The position of input character in current string. -1 means Not found.

◆ Right()

CFX_ByteString CFX_ByteString::Right ( FX_STRSIZE  count) const

Extracts the last (rightmost) count bytes from this CFX_ByteString object as a sub-string.

Parameters
[in]countThe count of bytes expected to extract for the sub-string.
Returns
A CFX_ByteString sub-string.

◆ SetAt()

void CFX_ByteString::SetAt ( FX_STRSIZE  nIndex,
FX_CHAR  ch 
)

Overwrites a single byte specified by an index number.

Parameters
[in]nIndexSpecifies the zero-based index in the byte string.
[in]chA single character.
Returns
None.

◆ TrimLeft() [1/3]

void CFX_ByteString::TrimLeft ( )

Trim white spaces from the left side of the byte string.

Returns
None.

◆ TrimLeft() [2/3]

void CFX_ByteString::TrimLeft ( FX_CHAR  chTarget)

Trim continuous occurrences of specified characters from left side of the byte string.

Parameters
[in]chTargetThe specified character.
Returns
None.

◆ TrimLeft() [3/3]

void CFX_ByteString::TrimLeft ( FX_BSTR  lpszTargets)

Trim continuous occurrences of specified characters from left side of the byte string.

Parameters
[in]lpszTargetsThe specified characters.
Returns
None.

◆ TrimRight() [1/3]

void CFX_ByteString::TrimRight ( )

Trim white spaces from the right side of the byte string.

Returns
None.

◆ TrimRight() [2/3]

void CFX_ByteString::TrimRight ( FX_CHAR  chTarget)

Trim continuous occurrences of specified character from right side of the byte string.

Parameters
[in]chTargetThe specified character.
Returns
None.

◆ TrimRight() [3/3]

void CFX_ByteString::TrimRight ( FX_BSTR  lpszTargets)

Trim continuous occurrences of specified characters from right side of the byte string.

Parameters
[in]lpszTargetsThe specified characters.
Returns
None.

◆ UTF8Decode()

CFX_WideString CFX_ByteString::UTF8Decode ( ) const

Decode a UTF-8 unicode string (assume this byte string is UTF-8 encoded).

Returns
A unicode string.

Foxit Software Corporation Logo
@2018 Foxit Software Incorporated. All rights reserved.