diff options
author | Stefan Radomski <github@mintwerk.de> | 2016-12-12 20:59:18 (GMT) |
---|---|---|
committer | Stefan Radomski <github@mintwerk.de> | 2016-12-12 20:59:18 (GMT) |
commit | e7747902e509cdbf895af3a7bc2025fe8193e3f7 (patch) | |
tree | 19ce2a4d5994ae95f7375e283d148affb501d5c7 /src/uscxml/util/Convenience.h | |
parent | 5d944642883e1f8951f1c2df5b7d72d06b5daee7 (diff) | |
download | uscxml-e7747902e509cdbf895af3a7bc2025fe8193e3f7.zip uscxml-e7747902e509cdbf895af3a7bc2025fe8193e3f7.tar.gz uscxml-e7747902e509cdbf895af3a7bc2025fe8193e3f7.tar.bz2 |
Reduced header dependencies
Diffstat (limited to 'src/uscxml/util/Convenience.h')
-rw-r--r-- | src/uscxml/util/Convenience.h | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/src/uscxml/util/Convenience.h b/src/uscxml/util/Convenience.h index 532bcc0..cb4416d 100644 --- a/src/uscxml/util/Convenience.h +++ b/src/uscxml/util/Convenience.h @@ -45,25 +45,7 @@ template <typename T> T strTo(std::string tmp) { class USCXML_API NumAttr { public: - NumAttr(const std::string& str) { - size_t valueStart = str.find_first_of("0123456789."); - if (valueStart != std::string::npos) { - size_t valueEnd = str.find_last_of("0123456789."); - if (valueEnd != std::string::npos) { - value = str.substr(valueStart, (valueEnd - valueStart) + 1); - size_t unitStart = str.find_first_not_of(" \t", valueEnd + 1); - if (unitStart != std::string::npos) { - size_t unitEnd = str.find_last_of(" \t"); - if (unitEnd != std::string::npos && unitEnd > unitStart) { - unit = str.substr(unitStart, unitEnd - unitStart); - } else { - unit = str.substr(unitStart, str.length() - unitStart); - } - } - } - } - } - + NumAttr(const std::string& str); std::string value; std::string unit; }; |