Ultralight C API 1.3.0
Loading...
Searching...
No Matches
CAPI_String.h File Reference

Go to the source code of this file.

Functions

ULExport ULString ulCreateString (const char *str)
 Create string from null-terminated ASCII C-string.
 
ULExport ULString ulCreateStringUTF8 (const char *str, size_t len)
 Create string from UTF-8 buffer.
 
ULExport ULString ulCreateStringUTF16 (ULChar16 *str, size_t len)
 Create string from UTF-16 buffer.
 
ULExport ULString ulCreateStringFromCopy (ULString str)
 Create string from copy of existing string.
 
ULExport void ulDestroyString (ULString str)
 Destroy string (you should destroy any strings you explicitly Create).
 
ULExport char * ulStringGetData (ULString str)
 Get native UTF-8 buffer data (always null-terminated).
 
ULExport size_t ulStringGetLength (ULString str)
 Get length (in bytes) of the UTF-8 buffer data, not including null terminator.
 
ULExport bool ulStringIsEmpty (ULString str)
 Whether this string is empty or not.
 
ULExport void ulStringAssignString (ULString str, ULString new_str)
 Replaces the contents of 'str' with the contents of 'new_str'.
 
ULExport void ulStringAssignCString (ULString str, const char *c_str)
 Replaces the contents of 'str' with the contents of a C-string.
 

Function Documentation

◆ ulCreateString()

ULExport ULString ulCreateString ( const char *  str)

Create string from null-terminated ASCII C-string.

◆ ulCreateStringFromCopy()

ULExport ULString ulCreateStringFromCopy ( ULString  str)

Create string from copy of existing string.

◆ ulCreateStringUTF16()

ULExport ULString ulCreateStringUTF16 ( ULChar16 str,
size_t  len 
)

Create string from UTF-16 buffer.

◆ ulCreateStringUTF8()

ULExport ULString ulCreateStringUTF8 ( const char *  str,
size_t  len 
)

Create string from UTF-8 buffer.

◆ ulDestroyString()

ULExport void ulDestroyString ( ULString  str)

Destroy string (you should destroy any strings you explicitly Create).

◆ ulStringAssignCString()

ULExport void ulStringAssignCString ( ULString  str,
const char *  c_str 
)

Replaces the contents of 'str' with the contents of a C-string.

◆ ulStringAssignString()

ULExport void ulStringAssignString ( ULString  str,
ULString  new_str 
)

Replaces the contents of 'str' with the contents of 'new_str'.

◆ ulStringGetData()

ULExport char * ulStringGetData ( ULString  str)

Get native UTF-8 buffer data (always null-terminated).

◆ ulStringGetLength()

ULExport size_t ulStringGetLength ( ULString  str)

Get length (in bytes) of the UTF-8 buffer data, not including null terminator.

◆ ulStringIsEmpty()

ULExport bool ulStringIsEmpty ( ULString  str)

Whether this string is empty or not.