summaryrefslogtreecommitdiff
path: root/shared/util.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:07:43 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:07:43 +0200
commit4226e548662339ea1ca37b45385a7cf9b237ff1e (patch)
tree9a3fa54b85d97f05164e41bdb96b82f748a37342 /shared/util.h
parent3.7 (diff)
downloadFreeFileSync-4226e548662339ea1ca37b45385a7cf9b237ff1e.tar.gz
FreeFileSync-4226e548662339ea1ca37b45385a7cf9b237ff1e.tar.bz2
FreeFileSync-4226e548662339ea1ca37b45385a7cf9b237ff1e.zip
3.8
Diffstat (limited to 'shared/util.h')
-rw-r--r--shared/util.h59
1 files changed, 56 insertions, 3 deletions
diff --git a/shared/util.h b/shared/util.h
index cc721ac1..25048132 100644
--- a/shared/util.h
+++ b/shared/util.h
@@ -10,6 +10,7 @@
#include "../shared/zstring.h"
#include <wx/string.h>
#include <wx/longlong.h>
+#include "../shared/globalFunctions.h"
class wxComboBox;
class wxTextCtrl;
@@ -25,9 +26,8 @@ wxString formatFilesizeToShortString(double filesize);
wxString formatPercentage(const wxLongLong& dividend, const wxLongLong& divisor);
-wxString numberToWxString(size_t number, bool includeNumberSep); //convert number to wxString
-wxString numberToWxString(int number, bool includeNumberSep); //convert number to wxString
-wxString numberToWxString(const wxULongLong& number, bool includeNumberSep); //convert number to wxString
+template <class NumberType>
+wxString numberToStringSep(NumberType number); //convert number to wxString including thousands separator
void setDirectoryName(const wxString& dirname, wxTextCtrl* txtCtrl, wxDirPickerCtrl* dirPicker);
void setDirectoryName(const wxString& dirname, wxComboBox* txtCtrl, wxDirPickerCtrl* dirPicker);
@@ -37,4 +37,57 @@ wxString utcTimeToLocalString(const wxLongLong& utcTime); //throw std::runtime_e
}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//--------------- inline impelementation -------------------------------------------
+
+//helper function! not to be used directly
+namespace FreeFileSync_Impl
+{
+wxString includeNumberSeparator(const wxString& number);
+}
+
+
+namespace FreeFileSync
+{
+//wxULongLongNative doesn't support operator<<(std::ostream&, wxULongLongNative)
+template <>
+inline
+wxString numberToStringSep(wxULongLongNative number)
+{
+ return FreeFileSync_Impl::includeNumberSeparator(number.ToString());
+}
+
+
+template <class NumberType>
+inline
+wxString numberToStringSep(NumberType number)
+{
+ return FreeFileSync_Impl::includeNumberSeparator(globalFunctions::numberToString(number));
+}
+}
+
+
#endif // UTIL_H_INCLUDED
bgstack15