summaryrefslogtreecommitdiffstats
path: root/Source/cmValue.h
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.h
parentcc56dc7468bfee49dedbf395d6fca5c372d200fe (diff)
downloadCMake-edf67dd039f40a4222e41cc15a197cb6395bf885.zip
CMake-edf67dd039f40a4222e41cc15a197cb6395bf885.tar.gz
CMake-edf67dd039f40a4222e41cc15a197cb6395bf885.tar.bz2
cmValue: add IsInternallyOn methods
Diffstat (limited to 'Source/cmValue.h')
-rw-r--r--Source/cmValue.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/Source/cmValue.h b/Source/cmValue.h
index 43a5e0d..c79b997 100644
--- a/Source/cmValue.h
+++ b/Source/cmValue.h
@@ -85,6 +85,17 @@ public:
return this->Value == nullptr || this->Value->empty();
}
+ /**
+ * Does a string indicates that CMake/CPack/CTest internally
+ * forced this value. This is not the same as On, but this
+ * may be considered as "internally switched on".
+ */
+ bool IsInternallyOn() const noexcept
+ {
+ return this->Value != nullptr &&
+ cmValue::IsInternallyOn(cm::string_view(*this->Value));
+ }
+
bool IsSet() const noexcept
{
return !this->IsEmpty() && !this->IsNOTFOUND();
@@ -131,6 +142,17 @@ public:
}
static bool IsEmpty(cm::string_view value) noexcept { return value.empty(); }
+ /**
+ * Does a string indicates that CMake/CPack/CTest internally
+ * forced this value. This is not the same as On, but this
+ * may be considered as "internally switched on".
+ */
+ static bool IsInternallyOn(const char* value) noexcept
+ {
+ return value != nullptr && IsInternallyOn(cm::string_view(value));
+ }
+ static bool IsInternallyOn(cm::string_view) noexcept;
+
private:
static std::string Empty;
const std::string* Value = nullptr;