Repository :
http://git.fedorahosted.org/cgit/firewalld-recode.git
On branch : master
---------------------------------------------------------------
commit aadf62168f909ee621378479f9178b47406061ac
Author: Daniel Kopecek <dkopecek(a)redhat.com>
Date: Thu Oct 2 11:19:58 2014 +0200
Added stringToNumber utility function
---------------------------------------------------------------
src/Common/Utility.hpp | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/Common/Utility.hpp b/src/Common/Utility.hpp
index b54e13b..271350a 100644
--- a/src/Common/Utility.hpp
+++ b/src/Common/Utility.hpp
@@ -57,6 +57,15 @@ namespace firewalld
return ss.str();
}
+ template<typename T>
+ T stringToNumber(const String& s)
+ {
+ std::istringstream ss(s);
+ T num;
+ ss >> num;
+ return num;
+ }
+
String filenameFromPath(const String& filepath, bool include_extension = false);
template<class StringType>