summaryrefslogtreecommitdiff
path: root/Source/cmSystemTools.cxx
diff options
context:
space:
mode:
authorSebastian Holtermann <sebholt@xwmw.org>2019-08-10 13:37:34 +0200
committerSebastian Holtermann <sebholt@xwmw.org>2019-08-10 14:39:03 +0200
commit935fbe0b0454163678bc4ef19e1bee95a7a31b4d (patch)
tree794eea739dbd5e5fc184539e4fdd856f8fad3364 /Source/cmSystemTools.cxx
parent32a7605e69e3faf56bf51da1641a7ae897d23826 (diff)
downloadcmake-935fbe0b0454163678bc4ef19e1bee95a7a31b4d.tar.gz
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.
Diffstat (limited to 'Source/cmSystemTools.cxx')
-rw-r--r--Source/cmSystemTools.cxx22
1 files changed, 0 insertions, 22 deletions
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 7baf5ed497..f1a652d305 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -2848,28 +2848,6 @@ bool cmSystemTools::RepeatedRemoveDirectory(const std::string& dir)
return false;
}
-bool cmSystemTools::StringToLong(const char* str, long* value)
-{
- errno = 0;
- char* endp;
- *value = strtol(str, &endp, 10);
- return (*endp == '\0') && (endp != str) && (errno == 0);
-}
-
-bool cmSystemTools::StringToULong(const char* str, unsigned long* value)
-{
- errno = 0;
- char* endp;
- while (isspace(*str)) {
- ++str;
- }
- if (*str == '-') {
- return false;
- }
- *value = strtoul(str, &endp, 10);
- return (*endp == '\0') && (endp != str) && (errno == 0);
-}
-
std::string cmSystemTools::EncodeURL(std::string const& in, bool escapeSlashes)
{
std::string out;