summaryrefslogtreecommitdiff
path: root/wx+/format_unit.h
diff options
context:
space:
mode:
Diffstat (limited to 'wx+/format_unit.h')
-rw-r--r--wx+/format_unit.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/wx+/format_unit.h b/wx+/format_unit.h
new file mode 100644
index 00000000..4adf74f8
--- /dev/null
+++ b/wx+/format_unit.h
@@ -0,0 +1,64 @@
+// **************************************************************************
+// * This file is part of the FreeFileSync project. It is distributed under *
+// * GNU General Public License: http://www.gnu.org/licenses/gpl.html *
+// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) *
+// **************************************************************************
+
+#ifndef UTIL_H_INCLUDED
+#define UTIL_H_INCLUDED
+
+#include <string>
+#include <zen/string_tools.h>
+#include <zen/int64.h>
+
+namespace zen
+{
+std::wstring filesizeToShortString(UInt64 filesize);
+std::wstring remainingTimeToShortString(double timeInSec);
+std::wstring percentageToShortString(double fraction); //within [0, 1]
+
+template <class NumberType>
+std::wstring toStringSep(NumberType number); //convert number to std::wstring including thousands separator
+
+std::wstring utcToLocalTimeString(Int64 utcTime); //throw std::runtime_error
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//--------------- inline impelementation -------------------------------------------
+namespace ffs_Impl
+{
+std::wstring includeNumberSeparator(const std::wstring& number);
+}
+
+template <class NumberType> inline
+std::wstring toStringSep(NumberType number)
+{
+ return ffs_Impl::includeNumberSeparator(zen::toString<std::wstring>(number));
+}
+}
+
+#endif // UTIL_H_INCLUDED
bgstack15