#include <string_view>
Go to the source code of this file.
◆ WPI_AllocateString()
char * WPI_AllocateString |
( |
struct WPI_String * |
wpiString, |
|
|
size_t |
length |
|
) |
| |
Allocates a WPI_String for the specified length.
The resultant string must be freed with WPI_FreeString().
- Parameters
-
wpiString | output string |
length | string length in chars to allocate |
- Returns
- mutable pointer to allocated buffer
◆ WPI_AllocateStringArray()
struct WPI_String * WPI_AllocateStringArray |
( |
size_t |
length | ) |
|
Allocates an array of WPI_Strings.
- Parameters
-
- Returns
- string array
◆ WPI_FreeString()
void WPI_FreeString |
( |
const struct WPI_String * |
wpiString | ) |
|
◆ WPI_FreeStringArray()
void WPI_FreeStringArray |
( |
const struct WPI_String * |
wpiStringArray, |
|
|
size_t |
length |
|
) |
| |
◆ WPI_InitString()
void WPI_InitString |
( |
struct WPI_String * |
wpiString, |
|
|
const char * |
utf8String |
|
) |
| |
Initializes a WPI_String from a null terminated UTF-8 string.
If input string is null, initializes output to 0 length. The output length does not include the null terminator.
The lifetime of the output string is the lifetime of the input string. Do not call WPI_FreeString() with the output of this call.
- Parameters
-
wpiString | output string |
utf8String | input string (null terminated) |
◆ WPI_InitStringWithLength()
void WPI_InitStringWithLength |
( |
struct WPI_String * |
wpiString, |
|
|
const char * |
utf8String, |
|
|
size_t |
length |
|
) |
| |
Initializes a WPI_String from a UTF-8 string and length.
If input string is null or 0 length, initilizes output to 0 length. The input string does not need to be null terminated.
The lifetime of the output string is the lifetime of the input string. Do not call WPI_FreeString() with the output of this call.
- Parameters
-
wpiString | output string |
utf8String | input string |
length | input string length in chars |