summaryrefslogtreecommitdiffstats
path: root/Source/cmValue.cxx
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2021-09-21 15:13:14 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2021-09-21 15:14:05 (GMT)
commitedf67dd039f40a4222e41cc15a197cb6395bf885 (patch)
tree70e7d2bf0b3d93c4d9a49dd5fe6b60d3b731f830 /Source/cmValue.cxx
parentcc56dc7468bfee49dedbf395d6fca5c372d200fe (diff)
downloadCMake-edf67dd039f40a4222e41cc15a197cb6395bf885.zip
CMake-edf67dd039f40a4222e41cc15a197cb6395bf885.tar.gz
CMake-edf67dd039f40a4222e41cc15a197cb6395bf885.tar.bz2
cmValue: add IsInternallyOn methods
Diffstat (limited to 'Source/cmValue.cxx')
-rw-r--r--Source/cmValue.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmValue.cxx b/Source/cmValue.cxx
index 59bf201..044db29 100644
--- a/Source/cmValue.cxx
+++ b/Source/cmValue.cxx
@@ -73,11 +73,21 @@ bool cmValue::IsOff(cm::string_view value) noexcept
return IsNOTFOUND(value);
}
+
bool cmValue::IsNOTFOUND(cm::string_view value) noexcept
{
return (value == "NOTFOUND"_s) || cmHasSuffix(value, "-NOTFOUND"_s);
}
+bool cmValue::IsInternallyOn(cm::string_view value) noexcept
+{
+ return (value.size() == 4) && //
+ (value[0] == 'I' || value[0] == 'i') && //
+ (value[1] == '_') && //
+ (value[2] == 'O' || value[2] == 'o') && //
+ (value[3] == 'N' || value[3] == 'n');
+}
+
int cmValue::Compare(cmValue value) const noexcept
{
if (this->Value == nullptr && !value) {