summaryrefslogtreecommitdiff
path: root/wx+/format_unit.h
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 17:15:16 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 17:15:16 +0200
commitbd6336c629841c6db3a6ca53a936d629d34db53b (patch)
tree3721ef997864108df175ce677a8a7d4342a6f1d2 /wx+/format_unit.h
parent4.0 (diff)
downloadFreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.tar.gz
FreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.tar.bz2
FreeFileSync-bd6336c629841c6db3a6ca53a936d629d34db53b.zip
4.1
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