From 3b6c62be238f48b23d7dad302702f723dc5ef89c Mon Sep 17 00:00:00 2001 From: Sebastian Holtermann Date: Sat, 17 Aug 2019 11:32:01 +0200 Subject: cmSystemTools: Remove IsInternallyOn, IsNOTFOUND, IsOn, IsOff The removes the following methods from cmSystemTools: - `IsInternallyOn` - `IsNOTFOUND` - `IsOn` - `IsOff` --- Source/cmSystemTools.cxx | 79 ------------------------------------------------ Source/cmSystemTools.h | 44 --------------------------- 2 files changed, 123 deletions(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index a133459..3461e67 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -250,85 +250,6 @@ void cmSystemTools::ReportLastSystemError(const char* msg) cmSystemTools::Error(m); } -bool cmSystemTools::IsInternallyOn(cm::string_view val) -{ - return (val.size() == 4) && // - (val[0] == 'I' || val[0] == 'i') && // - (val[1] == '_') && // - (val[2] == 'O' || val[2] == 'o') && // - (val[3] == 'N' || val[3] == 'n'); -} - -bool cmSystemTools::IsOn(cm::string_view val) -{ - switch (val.size()) { - case 1: - return val[0] == '1' || val[0] == 'Y' || val[0] == 'y'; - case 2: - return // - (val[0] == 'O' || val[0] == 'o') && // - (val[1] == 'N' || val[1] == 'n'); - case 3: - return // - (val[0] == 'Y' || val[0] == 'y') && // - (val[1] == 'E' || val[1] == 'e') && // - (val[2] == 'S' || val[2] == 's'); - case 4: - return // - (val[0] == 'T' || val[0] == 't') && // - (val[1] == 'R' || val[1] == 'r') && // - (val[2] == 'U' || val[2] == 'u') && // - (val[3] == 'E' || val[3] == 'e'); - default: - break; - } - - return false; -} - -bool cmSystemTools::IsNOTFOUND(cm::string_view val) -{ - return (val == "NOTFOUND") || cmHasLiteralSuffix(val, "-NOTFOUND"); -} - -bool cmSystemTools::IsOff(cm::string_view val) -{ - switch (val.size()) { - case 0: - return true; - case 1: - return val[0] == '0' || val[0] == 'N' || val[0] == 'n'; - case 2: - return // - (val[0] == 'N' || val[0] == 'n') && // - (val[1] == 'O' || val[1] == 'o'); - case 3: - return // - (val[0] == 'O' || val[0] == 'o') && // - (val[1] == 'F' || val[1] == 'f') && // - (val[2] == 'F' || val[2] == 'f'); - case 5: - return // - (val[0] == 'F' || val[0] == 'f') && // - (val[1] == 'A' || val[1] == 'a') && // - (val[2] == 'L' || val[2] == 'l') && // - (val[3] == 'S' || val[3] == 's') && // - (val[4] == 'E' || val[4] == 'e'); - case 6: - return // - (val[0] == 'I' || val[0] == 'i') && // - (val[1] == 'G' || val[1] == 'g') && // - (val[2] == 'N' || val[2] == 'n') && // - (val[3] == 'O' || val[3] == 'o') && // - (val[4] == 'R' || val[4] == 'r') && // - (val[5] == 'E' || val[5] == 'e'); - default: - break; - } - - return cmSystemTools::IsNOTFOUND(val); -} - void cmSystemTools::ParseWindowsCommandLine(const char* command, std::vector& args) { diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 9ccbbc5..953a358 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -94,50 +94,6 @@ public: cmSystemTools::s_ErrorOccured = false; } - /** - * 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(cm::string_view val); - static inline bool IsInternallyOn(const char* val) - { - if (!val) { - return false; - } - return IsInternallyOn(cm::string_view(val)); - } - - /** - * Does a string indicate a true or on value? This is not the same as ifdef. - */ - static bool IsOn(cm::string_view val); - inline static bool IsOn(const char* val) - { - if (!val) { - return false; - } - return IsOn(cm::string_view(val)); - } - - /** - * Does a string indicate a false or off value ? Note that this is - * not the same as !IsOn(...) because there are a number of - * ambiguous values such as "/usr/local/bin" a path will result in - * IsON and IsOff both returning false. Note that the special path - * NOTFOUND, *-NOTFOUND or IGNORE will cause IsOff to return true. - */ - static bool IsOff(cm::string_view val); - inline static bool IsOff(const char* val) - { - if (!val) { - return true; - } - return IsOff(cm::string_view(val)); - } - - //! Return true if value is NOTFOUND or ends in -NOTFOUND. - static bool IsNOTFOUND(cm::string_view val); //! Return true if the path is a framework static bool IsPathToFramework(const std::string& value); -- cgit v0.12