Final Platform Layer 0.9.8-beta
|
This category contains tons of functions for converting/manipulating strings. More...
Functions | |
fpl_common_api char * | fplCopyString (const char *source, char *dest, const size_t maxDestLen) |
Copies the given source string into a destination string. | |
fpl_common_api char * | fplCopyStringLen (const char *source, const size_t sourceLen, char *dest, const size_t maxDestLen) |
Copies the given source string with a constrained length into a destination string. | |
fpl_common_api char * | fplEnforcePathSeparator (char *path) |
Ensures that the given string always ends with a path separator. | |
fpl_common_api char * | fplEnforcePathSeparatorLen (char *path, size_t maxPathLen) |
Ensures that the given string always ends with a path separator with length constrained. | |
fpl_common_api size_t | fplGetStringLength (const char *str) |
Counts the number of characters without including the zero terminator. | |
fpl_common_api bool | fplIsStringEqual (const char *a, const char *b) |
Compares two strings and returns a boolean indicating the equality. | |
fpl_common_api bool | fplIsStringEqualLen (const char *a, const size_t aLen, const char *b, const size_t bLen) |
Compares two strings with constrained lengths and returns a boolean indicating the equality. | |
fpl_common_api bool | fplIsStringMatchWildcard (const char *source, const char *wildcard) |
Matches the given string by the given wildcard and returns a boolean indicating the match. | |
fpl_common_api size_t | fplS32ToString (const int32_t value, char *buffer, const size_t maxBufferLen) |
Converts the given 32-bit integer value into a string. | |
fpl_common_api char * | fplStringAppend (const char *appended, char *buffer, size_t maxBufferLen) |
Appends the source string to the given buffer. | |
fpl_common_api char * | fplStringAppendLen (const char *appended, const size_t appendedLen, char *buffer, size_t maxBufferLen) |
Appends the source string to the given buffer constrained by length. | |
fpl_common_api size_t | fplStringFormat (char *destBuffer, const size_t maxDestBufferLen, const char *format,...) |
Fills out the given destination string buffer with a formatted string, using the format specifier and variable arguments. | |
fpl_common_api size_t | fplStringFormatArgs (char *destBuffer, const size_t maxDestBufferLen, const char *format, va_list argList) |
Fills out the given destination string buffer with a formatted string, using the format specifier and the arguments list. | |
fpl_common_api int32_t | fplStringToS32 (const char *str) |
Converts the given string into a 32-bit integer. | |
fpl_common_api int32_t | fplStringToS32Len (const char *str, const size_t len) |
Converts the given string into a 32-bit integer constrained by string length. | |
fpl_platform_api size_t | fplUTF8StringToWideString (const char *utf8Source, const size_t utf8SourceLen, wchar_t *wideDest, const size_t maxWideDestLen) |
Converts the given 8-bit UTF-8 source ANSI string with length in a 16-bit wide string. | |
fpl_platform_api size_t | fplWideStringToUTF8String (const wchar_t *wideSource, const size_t wideSourceLen, char *utf8Dest, const size_t maxUtf8DestLen) |
Converts the given 16-bit source wide string with length in an 8-bit UTF-8 ANSI string. | |
This category contains tons of functions for converting/manipulating strings.
fpl_common_api char * fplCopyString | ( | const char * | source, |
char * | dest, | ||
const size_t | maxDestLen | ||
) |
Copies the given source string into a destination string.
source | The source string |
dest | The destination string buffer |
maxDestLen | The total number of characters available in the destination buffer |
fpl_common_api char * fplCopyStringLen | ( | const char * | source, |
const size_t | sourceLen, | ||
char * | dest, | ||
const size_t | maxDestLen | ||
) |
Copies the given source string with a constrained length into a destination string.
source | The source string |
sourceLen | The number of characters to copy |
dest | The destination string buffer |
maxDestLen | The total number of characters available in the destination buffer |
fpl_common_api char * fplEnforcePathSeparator | ( | char * | path | ) |
Ensures that the given string always ends with a path separator.
path | The path string |
fpl_common_api char * fplEnforcePathSeparatorLen | ( | char * | path, |
size_t | maxPathLen | ||
) |
Ensures that the given string always ends with a path separator with length constrained.
path | The target path string |
maxPathLen | The max length of the target path |
fpl_common_api size_t fplGetStringLength | ( | const char * | str | ) |
Counts the number of characters without including the zero terminator.
str | The string source |
fpl_common_api bool fplIsStringEqual | ( | const char * | a, |
const char * | b | ||
) |
Compares two strings and returns a boolean indicating the equality.
a | The first string |
b | The second string |
fpl_common_api bool fplIsStringEqualLen | ( | const char * | a, |
const size_t | aLen, | ||
const char * | b, | ||
const size_t | bLen | ||
) |
Compares two strings with constrained lengths and returns a boolean indicating the equality.
a | The first string |
aLen | The number of characters for the first string |
b | The second string |
bLen | The number of characters for the second string |
fpl_common_api bool fplIsStringMatchWildcard | ( | const char * | source, |
const char * | wildcard | ||
) |
Matches the given string by the given wildcard and returns a boolean indicating the match.
source | The source string |
wildcard | The wildcard string |
fpl_common_api size_t fplS32ToString | ( | const int32_t | value, |
char * | buffer, | ||
const size_t | maxBufferLen | ||
) |
Converts the given 32-bit integer value into a string.
value | The source value |
maxBufferLen | The maximum length of the buffer |
buffer | The target buffer |
fpl_common_api char * fplStringAppend | ( | const char * | appended, |
char * | buffer, | ||
size_t | maxBufferLen | ||
) |
Appends the source string to the given buffer.
appended | The appending source string |
buffer | The target buffer |
maxBufferLen | The max length of the target buffer |
fpl_common_api char * fplStringAppendLen | ( | const char * | appended, |
const size_t | appendedLen, | ||
char * | buffer, | ||
size_t | maxBufferLen | ||
) |
Appends the source string to the given buffer constrained by length.
appended | The appending source string |
appendedLen | The length of the appending source string |
buffer | The target buffer |
maxBufferLen | The max length of the target buffer |
fpl_common_api size_t fplStringFormat | ( | char * | destBuffer, |
const size_t | maxDestBufferLen, | ||
const char * | format, | ||
... | |||
) |
Fills out the given destination string buffer with a formatted string, using the format specifier and variable arguments.
destBuffer | The destination string buffer |
maxDestBufferLen | The total number of characters available in the destination buffer |
format | The string format |
... | The variable arguments |
fpl_common_api size_t fplStringFormatArgs | ( | char * | destBuffer, |
const size_t | maxDestBufferLen, | ||
const char * | format, | ||
va_list | argList | ||
) |
Fills out the given destination string buffer with a formatted string, using the format specifier and the arguments list.
destBuffer | The destination string buffer |
maxDestBufferLen | The total number of characters available in the destination buffer |
format | The string format |
argList | The arguments list |
fpl_common_api int32_t fplStringToS32 | ( | const char * | str | ) |
Converts the given string into a 32-bit integer.
str | The source string |
fpl_common_api int32_t fplStringToS32Len | ( | const char * | str, |
const size_t | len | ||
) |
Converts the given string into a 32-bit integer constrained by string length.
str | The source string |
len | The length of the source string |
fpl_platform_api size_t fplUTF8StringToWideString | ( | const char * | utf8Source, |
const size_t | utf8SourceLen, | ||
wchar_t * | wideDest, | ||
const size_t | maxWideDestLen | ||
) |
Converts the given 8-bit UTF-8 source ANSI string with length in a 16-bit wide string.
utf8Source | The 8-bit source ANSI string |
utf8SourceLen | The number of characters of the UTF-8 source ANSI string |
wideDest | The 16-bit destination wide string buffer |
maxWideDestLen | The total number of characters available in the destination buffer |
fpl_platform_api size_t fplWideStringToUTF8String | ( | const wchar_t * | wideSource, |
const size_t | wideSourceLen, | ||
char * | utf8Dest, | ||
const size_t | maxUtf8DestLen | ||
) |
Converts the given 16-bit source wide string with length in an 8-bit UTF-8 ANSI string.
wideSource | The 16-bit source wide string |
wideSourceLen | The number of characters of the source wide string |
utf8Dest | The 8-bit destination ANSI string buffer |
maxUtf8DestLen | The total number of characters available in the destination buffer |