cmd screen
This commit is contained in:
@@ -133,6 +133,20 @@ bool_t stringToU16(const char_t *str, uint16_t *out) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool_t stringToF32(const char_t *str, float_t *out) {
|
||||
assertNotNull(str, "str must not be NULL");
|
||||
assertNotNull(out, "out must not be NULL");
|
||||
|
||||
char_t *endptr;
|
||||
errno = 0;
|
||||
float_t result = strtof(str, &endptr);
|
||||
if (errno != 0 || *endptr != '\0') {
|
||||
return false;
|
||||
}
|
||||
*out = 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");
|
||||
|
||||
@@ -127,6 +127,15 @@ bool_t stringToI16(const char_t *str, int16_t *out);
|
||||
*/
|
||||
bool_t stringToU16(const char_t *str, uint16_t *out);
|
||||
|
||||
/**
|
||||
* Converts a string to a float.
|
||||
*
|
||||
* @param str The string to convert.
|
||||
* @param out The output float.
|
||||
* @return TRUE if the conversion was successful, FALSE otherwise.
|
||||
*/
|
||||
bool_t stringToF32(const char_t *str, float_t *out);
|
||||
|
||||
/**
|
||||
* Determines if a string ends with a specified suffix.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user