mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 13:20:47 -06:00
Merge topic 'cmnonempty'
eaad8072ee cmNonempty: Convenience inlines to check for non-empty string
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5017
This commit is contained in:
@@ -20,6 +20,20 @@
|
||||
/** String range type. */
|
||||
using cmStringRange = cmRange<std::vector<std::string>::const_iterator>;
|
||||
|
||||
/** Check for non-empty string. */
|
||||
inline bool cmNonempty(const char* str)
|
||||
{
|
||||
return str && *str;
|
||||
}
|
||||
inline bool cmNonempty(cm::string_view str)
|
||||
{
|
||||
return !str.empty();
|
||||
}
|
||||
inline bool cmNonempty(std::string const* str)
|
||||
{
|
||||
return str && !str->empty();
|
||||
}
|
||||
|
||||
/** Callable string comparison struct. */
|
||||
struct cmStrCmp
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user