* @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. */
| 531 | * @return true if the String object is empty or NULL, false otherwise. |
| 532 | */ |
| 533 | bool 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 | /** |
no outgoing calls
no test coverage detected