cmStringAlgorithms: Add cmStrToLong and cmStrToULong

This adds the following functions to cmStringAlgorithms:
- `cmStrToLong`: moved from `cmSystemTools::StringToLong`
- `cmStrToULong`: moved from `cmSystemTools::StringToULong`

Overloads of the given functions for `std::string` are added as well.
This commit is contained in:
Sebastian Holtermann
2019-08-10 13:37:34 +02:00
parent 32a7605e69
commit 935fbe0b04
20 changed files with 105 additions and 74 deletions
-4
View File
@@ -500,10 +500,6 @@ public:
/** Remove a directory; repeat a few times in case of locked files. */
static bool RepeatedRemoveDirectory(const std::string& dir);
/** Convert string to long. Expected that the whole string is an integer */
static bool StringToLong(const char* str, long* value);
static bool StringToULong(const char* str, unsigned long* value);
/** Encode a string as a URL. */
static std::string EncodeURL(std::string const& in,
bool escapeSlashes = true);