MCPcopy Create free account
hub / github.com/KaisenAmin/c_std / string_empty

Function string_empty

string/std_string.c:533–545  ·  view source on GitHub ↗

* @brief Checks if the given String object is empty. * * This function checks whether the String object is empty, meaning it contains no characters or is NULL. * * @param str The String object to check. Can be NULL. * * @return true if the String object is empty or NULL, false otherwise. */

Source from the content-addressed store, hash-verified

531 * @return true if the String object is empty or NULL, false otherwise.
532 */
533bool string_empty(const String* str) {
534 STRING_LOG("[string_empty]: Checking if the string is empty.\n");
535
536 if (str == NULL) {
537 STRING_LOG("[string_empty]: The String object is NULL.\n");
538 return true;
539 }
540
541 bool isEmpty = (str->size == 0);
542 STRING_LOG("[string_empty]: String is %s.\n", isEmpty ? "empty" : "not empty");
543
544 return isEmpty;
545}
546
547
548/**

Callers 5

string_to_intFunction · 0.85
string_to_floatFunction · 0.85
string_to_doubleFunction · 0.85
string_to_hexFunction · 0.85
string_from_hexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected