Celeritas  0.5.0-86+4a8eea4
Functions
StringUtils.hh File Reference

Helper functions for string processing. More...

#include <cstdlib>
#include <string_view>
This graph shows which files directly or indirectly include this file:

Functions

bool celeritas::starts_with (std::string_view main_string, std::string_view prefix)
 Whether the string starts with another string.
 
bool celeritas::ends_with (std::string_view main_string, std::string_view suffix)
 Whether the string ends with another string.
 
bool celeritas::is_ignored_trailing (unsigned char c)
 Whether the character is whitespace or unprintable.
 
bool celeritas::cstring_equal (char const *lhs, char const *rhs)
 Test C strings for equality, allowing one or the other to be null. More...
 
std::string_view celeritas::trim (std::string_view input)
 Return a string view with leading and trailing whitespace removed.
 

Detailed Description

Helper functions for string processing.

Function Documentation

◆ cstring_equal()

bool celeritas::cstring_equal ( char const *  lhs,
char const *  rhs 
)

Test C strings for equality, allowing one or the other to be null.

If one pointer is null, the result compares false.