The strxxx class gives your external components convenient ways to manipulate strings. Once your string is encapsulated inside the string class, it can be passed back and forth to OMNIS or have various string operations performed on it.
The string class is split into three real classes, each derived from a base class strxxx. You should not need to access the strxxx base class directly. Three classes are derived from strxxx: str15, str80, and str255. Each can hold the maximum number of characters as specified by the class name.
Characters in the string class are indexed using a range 1 to n. Index 0 is used to store the real length of the string.
The strxxx class has various constructors called from the three derived classes.
void strxxx::assign( const strxxx& pAssignFrom ) |
---|
Assigns one strxxx class to another.
pAssignFrom - The string to be copied into this object.
void strxxx::compare( const strxxx& pCompare ) |
---|
Compares two strings, this string and the string passed.
pCompare - This string to compare against.
void strxxx::concat( const strxxx& pNewString ) |
---|
Concatenates two strings together.
pNewString - String to be concatenated on to this string.
void strxxx::concat( qchar pChar ) |
---|
Concatenates a single character on to this string.
pChar - The character to be concatenated on to this string.
void strxxx::concat(const strxxx& pString1, const strxxx& pString2 ) void strxxx::concat(const strxxx& pString1, const strxxx& pString2, const strxxx& pString3 ) void strxxx::concat(const strxxx& pString1, const strxxx& pString2, const strxxx& pString3, const strxxx& pString4 ) |
---|
Concatenates a group of strings together on to this string.
pString1- String 1 to be concatenated.
pString2- String 2 to be concatenated.
pString3- String 3 to be concatenated.
pString4- String 4 to be concatenated.
void strxxx::copy( const strxxx& pExtractFrom, qshort pStart, qshort pLen ) |
---|
Copies a ranges of characters from the passed string, and uses them to set the contents of this.
pExtractFrom - The string to extract characters from.
pStart - The starting index in pExtractFrom.
pExtractFrom - The number of characters to copy from pExtractFrom.
qchar* strxxx::cString() |
---|
Returns the address of a c-style string. This function converts this string into a c-style string first. A c-style string uses a null terminator, character 0x0 to represent the end of the strings data.
return - The address to a c-style string.
void strxxx::deleet( qshort pPos, qshort pLen ) |
---|
Deletes a range of characters from a starting point in the string. (Note it is named deleet so it does not interfere with the default C++ delete.)
pPos - The starting index to delete from.
pLen - The number of characters to be deleted.
void strxxx::insert(const strxxx& pInsertString ,qshort pPos ) |
---|
Inserts a string at an index position.
pInsertString - The string to be inserted.
pPos - The index at which to insert the string.
void strxxx::insert( qchar pInsertChar ,qshort pPos ) |
---|
Inserts a single character at an index position.
pInsertChar - The character to be inserted.
pPos - The index at which to insert the character.
void strxxx::insertStr(const strxxx& pInsertString ) |
---|
Searches the string for a ‘$’ and inserts a sub-string pInsertString replacing the ‘$’.
pInsertString - The string to be inserted.
void strxxx::insertStr0( const strxxx& pInsertString ) |
---|
Similar to strxxx::insertStr(), except that it searches for the character 0x0 instead of ‘$’.
qshort strxxx::length() |
---|
Returns the length of the string stored in the object.
returns - The length of the string.
qshort strxxx::maxLength() |
---|
Returns the maximum length that can be stored in the string.
returns - The maximum length of the string.
qbool strxxx::operator ! () |
---|
Test is this string is not empty.
return - Returns qtrue if the string contains some data.
qbool strxxx::operator !=(const strxxx& pCompare ) |
---|
Compares two strings.
return - qtrue if the strings do not match and qtrue if the strings are the same.
qchar& strxxx::operator [ ] ( qshort pIndex ) |
---|
Returns the character from the string at the passed index.
pIndex - The index to return a character from.
return - The character from index [pIndex].
qbool strxxx::operator < ( const strxxx& pCompare ) |
---|
Compares two strings.
return - qtrue if this string is less than pCompare.
qbool strxxx::operator <=( const strxxx& pCompare ) |
---|
Compares two strings.
return - qtrue if this string is less than or equal to pCompare.
void strxxx::operator = ( const strxxx& pNewString ) |
---|
Assigns a string.
pNewString - Assigned pNewString to this string.
void strxxx::operator =(qniltype qnil1) |
---|
Sets the length of the string to 0.
qbool strxxx::operator ==( const strxxx& pCompare ) |
---|
Compares two strings.
return - qtrue if the strings match and qfalse if the strings are different.
qbool strxxx::operator >( const strxxx& pCompare ) |
---|
Compares two strings.
return - qtrue if this string is greater than pCompare.
qbool strxxx::operator >=( const strxxx& pCompare ) |
---|
Compares two strings.
return - qtrue if this string is greater than or equal to pCompare.
qshort strxxx::pos(const strxxx& pFind ) |
---|
Looks for the string pFind inside this.
pFind - The string to search for.
returns - The index if the string is found. 0 is returned if the string is not found.
qshort strxxx::pos(qchar pFindChar ) |
---|
Looks for the first occurrence of pFindChar inside this.
pFindChar - The character to search for.
returns - The index if the string is found. 0 is returned if the string is not found.
qchar* strxxx::pString() |
---|
Returns the address of a Pascal-style string. This function converts this string into a Pascal string first. A Pascal-style string uses the first byte of the string, index 0 as a length byte. The following characters, index 1 to n, are string data.
return - The address to a Pascal string.
void strxxx::repWith0() |
---|
Replaces all ‘$’ characters with a 0x0 character.
void strxxx::upps() |
---|
Converts this to uppercase.
void strxxx::uprCmp( const strxxx& pCompare ) |
---|
Performs a case-insensitive comparison.
pCompare - This string to compare against.
return - This function returns:
0 if the strings match.
1 if this string is greater than pCompare.
-1 if this string is less than pCompare.
str15::str15() |
---|
Constructor for an empty str15 string class.
str15::str15( const str15& pCopyFrom ) |
---|
Constructor for a new str15 object duplicating the contents of another str15 object.
str15::str15( const strxxx& pCopyFrom ) |
---|
Constructor for a new str15 object duplicating the contents of another strxxx object.
pCopyFrom - The string to copy the initial value from to a maximum of 15 characters.
str15::str15(const void* pData ) |
---|
Constructor for a new str15 object setting an initial value.
pData - This must be a null-terminated, c-style string. The new string has stores a maximum of 15 characters.
str15::str15(qshort pLen, const void* pData ) |
---|
Constructor for a new str15 object setting an initial value.
pLen - The number of characters to copy from pData.
pData - The source of the initial data for the new string.
str15::str15(qchar pChar ) |
---|
Constructor for a new str15 object setting an initial value.
pChar - The initial value for the new string.
str80::str80() |
---|
Constructor for an empty str80 string class.
str80::str80( const str80& pCopyFrom ) |
---|
Constructor for a new str80 object duplicating the contents of another str80 object.
str80::str80( const strxxx& pCopyFrom ) |
---|
Constructor for a new str80 object duplicating the contents of another strxxx object.
pCopyFrom - The string to copy the initial value from to a maximum of 80 characters.
str80::str80(const void* pData ) |
---|
Constructor for a new str80 object setting an initial value.
pData - This must be a null-terminated, c-style string. The new string has a maximum of 80 characters.
str80::str80(qshort pLen, const void* pData ) |
---|
Constructor for a new str80 object setting an initial value.
pLen - The number of character to copy from pData.
pData - The source of the initial data for the new string.
str80::str80(qchar pChar ) |
---|
Constructor for a new str80 object setting an initial value.
str255::str255() |
---|
Constructor for an empty str255 string class.
str255::str255( const str255& pCopyFrom ) |
---|
Constructor for a new str255 object duplicating the contents of another str255 object.
str255::str255( const strxxx& pCopyFrom ) |
---|
Constructor for a new str255 object duplicating the contents of another strxxx object.
pCopyFrom - The string to copy the initial value from to a maximum of 255 characters.
str255::str255(const void* pData ) |
---|
Constructor for a new str255 object setting an initial value.
pData - This must be a null-terminated, c-style string. The new string has a maximum of 255 characters.
str255::str255(qshort pLen, const void* pData ) |
---|
Constructor for a new str255 object setting an initial value.
pLen - The number of character to copy from pData.
pData - The source of the initial data for the new string.
str255::str255(qchar pChar ) |
---|
Constructor for a new str255 object setting an initial value.
pChar - The initial value for the new string.
void qlongToString(qlong pVal, strxxx& pString ) |
---|
Converts a numeric value into a string value.
pVal - The number to convert.
pString - The string to receive the converted result.
void qrealToString(qreal pVal, qshort pDecimalPlace, strxxx& pString, qshort pSigDecimalPlace ) |
---|
Converts a numeric value into a string value.
pVal - The number to convert.
pDecimalPlace - The number of decimal places to convert to.
pString - The string to contain the converted result.
pSigDecimalPlace - This is the number of significant digits the string is converted to if the decimal places passed is larger than or equal to 24.
qbool stringToQlong(const strxxx& pString, qlong& pVal ) |
---|
Converts a string into a numeric value.
pString - The string to convert.
pVal - The numeric result.
returns - qtrue if the string could be converted, and qfalse if the string could not be converted.
qbool stringToQreal(const strxxx& pString, qreal& pVal, qshort& pDecimalPlace ) |
---|
Converts a string into a numeric value.
pString - The string to convert.
pVal - The numeric result.
pDecimalPlace - Returns the number of decimal the converted value has.
returns - qtrue if the string could be converted, and qfalse if the string could not be converted.
qchar lowC( qchar pChar ) |
---|
Converts a single character to lowercase.
pChar - The character to be converted.
returns - The new lowercase character.
qchar uppC( qchar pChar ) |
---|
Converts a single character to uppercase.
pString - The character to be converted.
returns - The new uppercase character.
void uppC( qchar* pAddress, qlong pLen ) |
---|
Converts a range of characters to uppercase.
pAddress - The address of a buffer of characters to be uppercased.
pLen - The number of characters to uppercase.
qshort uprCmp( qchar* pAddress, qchar* pAddress2, qlong pLen ) |
---|
Performs a case insensitive comparison on two buffers for a specified length.
pAddress1 - The address to a buffer of characters.
pAddress2 - The address to a buffer of characters.
pLen - The number of characters to uppercase in both strings.
return - This function returns:
0 if the strings match.
1 if this string is greater than pCompare.
-1 if this string is less than pCompare.