summaryrefslogtreecommitdiff
path: root/library/globalFunctions.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 16:44:25 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 16:44:25 +0200
commitc63d9b438572f06f555e2232a15bd3c46bd10546 (patch)
tree92f2eca00f2a915078ee979acf26906670d75e5f /library/globalFunctions.h
downloadFreeFileSync-c63d9b438572f06f555e2232a15bd3c46bd10546.tar.gz
FreeFileSync-c63d9b438572f06f555e2232a15bd3c46bd10546.tar.bz2
FreeFileSync-c63d9b438572f06f555e2232a15bd3c46bd10546.zip
1.2
Diffstat (limited to 'library/globalFunctions.h')
-rw-r--r--library/globalFunctions.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/library/globalFunctions.h b/library/globalFunctions.h
new file mode 100644
index 00000000..90c4aa99
--- /dev/null
+++ b/library/globalFunctions.h
@@ -0,0 +1,36 @@
+#ifndef GLOBALFUNCTIONS_H_INCLUDED
+#define GLOBALFUNCTIONS_H_INCLUDED
+
+#include <string>
+#include <algorithm>
+#include <wx/string.h>
+#include <stdexcept> //for std::runtime_error
+
+using namespace std;
+
+namespace GlobalFunctions
+{
+ int round(double d); //little rounding function
+
+ int abs(const int d); //absolute value
+ unsigned int abs(const unsigned int d); //absolute value
+ float abs(const float d); //absolute value
+ double abs(const double d); //absolute value
+
+ string numberToString(const unsigned int number); //Convert number to string
+ string numberToString(const int number); //Convert number to string
+ string numberToString(const float number); //Convert number to string
+
+ wxString numberToWxString(const unsigned int number); //Convert number to wxString
+ wxString numberToWxString(const int number); //Convert number to wxString
+ wxString numberToWxString(const float number); //Convert number to wxString
+
+ int stringToInt( const string& number); //Convert String to number
+ double stringToDouble(const string& number); //Convert String to number
+
+ int wxStringToInt( const wxString& number); //Convert wxString to number
+ double wxStringToDouble(const wxString& number); //Convert wxString to number
+
+ wxString& includeNumberSeparator(wxString& number);
+}
+#endif // GLOBALFUNCTIONS_H_INCLUDED
bgstack15