Move helpers functions from cmStringAlgorithms.h to cmValue.h

Helpers functions related to cmValue semantic are now part of
cmValue.h header.
This commit is contained in:
Marc Chevrier
2021-09-21 17:38:59 +02:00
parent edf67dd039
commit 59ad7a1c24
16 changed files with 88 additions and 83 deletions

View File

@@ -219,84 +219,6 @@ std::string cmWrap(char prefix, Range const& rng, char suffix,
sep);
}
/**
* 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".
*/
inline bool cmIsInternallyOn(cm::string_view val)
{
return cmValue::IsInternallyOn(val);
}
inline bool cmIsInternallyOn(const char* val)
{
return cmValue::IsInternallyOn(val);
}
inline bool cmIsInternallyOn(cmValue val)
{
return val.IsInternallyOn();
}
/** Check for non-empty Property/Variable value. */
inline bool cmNonempty(cm::string_view val)
{
return !cmValue::IsEmpty(val);
}
inline bool cmNonempty(const char* val)
{
return !cmValue::IsEmpty(val);
}
inline bool cmNonempty(cmValue val)
{
return !val.IsEmpty();
}
/** Return true if value is NOTFOUND or ends in -NOTFOUND. */
inline bool cmIsNOTFOUND(cm::string_view val)
{
return cmValue::IsNOTFOUND(val);
}
inline bool cmIsNOTFOUND(cmValue val)
{
return val.IsNOTFOUND();
}
/**
* Does a string indicate a true or ON value? This is not the same as ifdef.
*/
inline bool cmIsOn(cm::string_view val)
{
return cmValue::IsOn(val);
}
inline bool cmIsOn(const char* val)
{
return cmValue::IsOn(val);
}
inline bool cmIsOn(cmValue val)
{
return val.IsOn();
}
/**
* 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.
*/
inline bool cmIsOff(cm::string_view val)
{
return cmValue::IsOff(val);
}
inline bool cmIsOff(const char* val)
{
return cmValue::IsOff(val);
}
inline bool cmIsOff(cmValue val)
{
return val.IsOff();
}
/** Returns true if string @a str starts with the character @a prefix. */
inline bool cmHasPrefix(cm::string_view str, char prefix)
{