summaryrefslogtreecommitdiff
path: root/orkbasecxx
diff options
context:
space:
mode:
authorHenri Herscher <henri@oreka.org>2008-02-20 20:43:03 +0000
committerHenri Herscher <henri@oreka.org>2008-02-20 20:43:03 +0000
commit3aa8a40ede53e566ebe254bf9efc7f6ff8fa5af4 (patch)
tree2e827f912db4bfe1289fe659fa25d62c87637dba /orkbasecxx
parent42969445daa363f0b3ed371d99206e8b91c37215 (diff)
Added StringIsDigit() convenience function.
git-svn-id: https://oreka.svn.sourceforge.net/svnroot/oreka/trunk@523 09dcff7a-b715-0410-9601-b79a96267cd0
Diffstat (limited to 'orkbasecxx')
-rw-r--r--orkbasecxx/Utils.cpp17
-rw-r--r--orkbasecxx/Utils.h2
2 files changed, 19 insertions, 0 deletions
diff --git a/orkbasecxx/Utils.cpp b/orkbasecxx/Utils.cpp
index 272a90d..c06437f 100644
--- a/orkbasecxx/Utils.cpp
+++ b/orkbasecxx/Utils.cpp
@@ -9,6 +9,23 @@
#endif
//========================================================
+// String related stuff
+
+bool StringIsDigit(CStdString& string)
+{
+ int size = string.size();
+ for(int i=0; i<size; i++)
+ {
+ if(isdigit(string.GetAt(i)) == false)
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+
+//========================================================
// file related stuff
CStdString FileBaseName(CStdString& path)
diff --git a/orkbasecxx/Utils.h b/orkbasecxx/Utils.h
index 048d7c9..610823d 100644
--- a/orkbasecxx/Utils.h
+++ b/orkbasecxx/Utils.h
@@ -66,6 +66,8 @@ inline double StringToDouble(CStdString& value)
return doubleValue;
}
+bool DLL_IMPORT_EXPORT_ORKBASE StringIsDigit(CStdString& string);
+
//========================================================
// file related stuff