QuesaString.h


Discussion

Declares the Quesa string objects.

Functions


Q3CString_EmptyData


( TQ3Status ) Q3CString_EmptyData (
    char **str
);
Discussion

Releases the memory allocated by a previous call to Q3CString_GetString.

After the string data has been freed, the str parameter will be reset to NULL.

Parameter Descriptions
str
The string data to release.
function result
Success or failure of the operation.

Q3CString_GetLength


( TQ3Status ) Q3CString_GetLength (
    TQ3StringObject stringObj,
    TQ3Uns32 *length
);
Discussion

Get the length of a string object.

Returns the number of bytes required to store the character data in the string object. The length returned does not include the terminating NULL byte.

Parameter Descriptions
stringObj
The object to test.
length
The number of bytes needed for character data.
function result
Success or failure of the operation.

Q3CString_GetString


( TQ3Status ) Q3CString_GetString (
    TQ3StringObject stringObj,
    char **str
);
Discussion

Return the character data of a string object.

The data returned must be released with a subsequent call to Q3CString_EmptyData. The data returned will be NULL terminated.

The str parameter is overwritten, and so must not point to an existing string or a memory leak will occur. If the value of the str parameter is not NULL, a warning will be posted.

Parameter Descriptions
stringObj
The object to query.
str
Receives a pointer to the character data.
function result
Success or failure of the operation.

Q3CString_New


( TQ3StringObject ) Q3CString_New (
    const char *str
);
Discussion

Create a new C string object.

Creates a string object based on a NULL terminated string. The string data is copied, and so str can be disposed of after creating the object.

Parameter Descriptions
str
The C string to copy.
function result
The new string object.

Q3CString_SetString


( TQ3Status ) Q3CString_SetString (
    TQ3StringObject stringObj,
    const char *str
);
Discussion

Set the character data of a string object.

Assigns a C string to the string object. The string data is copied and so str can be disposed of after this call.

Parameter Descriptions
stringObj
The object to update.
str
The string to assign to the object.
function result
Success or failure of the operation.

Q3String_GetType


( TQ3ObjectType ) Q3String_GetType (
    TQ3StringObject stringObj
);
Discussion

Returns the type of a string object.

Returns kQ3StringTypeCString, or kQ3ObjectTypeInvalid if the object type is unknown.

Parameter Descriptions
stringObj
The object to test.
function result
The type of the object.

© 1999-2008 Quesa Developers (Last Updated 5/10/2008)