commit asset prog
This commit is contained in:
@@ -125,4 +125,14 @@ bool_t stringToU16(const char_t *str, uint16_t *out) {
|
||||
}
|
||||
*out = (uint16_t)result;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool_t stringEndsWith(const char_t *str, const char_t *suffix) {
|
||||
assertNotNull(str, "str must not be NULL");
|
||||
assertNotNull(suffix, "suffix must not be NULL");
|
||||
|
||||
size_t strLen = strlen(str);
|
||||
size_t suffixLen = strlen(suffix);
|
||||
if(suffixLen > strLen) return false;
|
||||
return strcmp(str + strLen - suffixLen, suffix) == 0;
|
||||
}
|
||||
@@ -115,4 +115,13 @@ bool_t stringToI16(const char_t *str, int16_t *out);
|
||||
* @param out The output unsigned integer.
|
||||
* @return TRUE if the conversion was successful, FALSE otherwise.
|
||||
*/
|
||||
bool_t stringToU16(const char_t *str, uint16_t *out);
|
||||
bool_t stringToU16(const char_t *str, uint16_t *out);
|
||||
|
||||
/**
|
||||
* Determines if a string ends with a specified suffix.
|
||||
*
|
||||
* @param str The string to check.
|
||||
* @param suffix The suffix to check for.
|
||||
* @return TRUE if the string ends with the suffix, FALSE otherwise.
|
||||
*/
|
||||
bool_t stringEndsWith(const char_t *str, const char_t *suffix);
|
||||
Reference in New Issue
Block a user