summaryrefslogtreecommitdiffstats
path: root/Source/cmStringAlgorithms.h
diff options
context:
space:
mode:
authorVitaly Stakhovsky <vvs31415@gitlab.org>2020-07-14 01:00:00 (GMT)
committerVitaly Stakhovsky <vvs31415@gitlab.org>2020-07-14 12:22:24 (GMT)
commit715691124240b696c8be1d7cd6ce6dbb09381c67 (patch)
tree85829a543a5d041e7329ae2e447b3d261ea640b8 /Source/cmStringAlgorithms.h
parent2da778664d3e99ada4e67a5a1b9d377f92a9f75f (diff)
downloadCMake-715691124240b696c8be1d7cd6ce6dbb09381c67.zip
CMake-715691124240b696c8be1d7cd6ce6dbb09381c67.tar.gz
CMake-715691124240b696c8be1d7cd6ce6dbb09381c67.tar.bz2
cmIsOn: add overload accepting const std::string*
Diffstat (limited to 'Source/cmStringAlgorithms.h')
-rw-r--r--Source/cmStringAlgorithms.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/cmStringAlgorithms.h b/Source/cmStringAlgorithms.h
index a5ecca7..3d5bf7e 100644
--- a/Source/cmStringAlgorithms.h
+++ b/Source/cmStringAlgorithms.h
@@ -205,10 +205,11 @@ bool cmIsNOTFOUND(cm::string_view val);
bool cmIsOn(cm::string_view val);
inline bool cmIsOn(const char* val)
{
- if (!val) {
- return false;
- }
- return cmIsOn(cm::string_view(val));
+ return val && cmIsOn(cm::string_view(val));
+}
+inline bool cmIsOn(std::string const* val)
+{
+ return val && cmIsOn(*val);
}
/**
@@ -221,10 +222,11 @@ inline bool cmIsOn(const char* val)
bool cmIsOff(cm::string_view val);
inline bool cmIsOff(const char* val)
{
- if (!val) {
- return true;
- }
- return cmIsOff(cm::string_view(val));
+ return !val || cmIsOff(cm::string_view(val));
+}
+inline bool cmIsOff(std::string const* val)
+{
+ return !val || cmIsOff(*val);
}
/** Returns true if string @a str starts with the character @a prefix. */