Store db_full_size[_u] statistics as UINT64

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6459 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2014-04-05 16:50:11 +00:00
parent 4ac358dc35
commit 45b87a7dc5
4 changed files with 50 additions and 32 deletions

View file

@ -35,7 +35,6 @@
extern double my_wtof(const wchar_t *str);
extern unsigned int my_strncpy(TCHAR*Dest, const TCHAR*Src, unsigned int cchMax);
size_t my_strftime(TCHAR *s, size_t max, const TCHAR *fmt, const struct tm *tm);
const TCHAR* GetFriendlySize(UINT64 n, unsigned int&fn, bool accurate = false);
// Adds the bitmap in filename using resource editor re as id id.
// If width or height are specified it will also make sure the bitmap is in that size
@ -78,6 +77,22 @@ public:
operator T*() { return GetPtr(); }
};
typedef enum {
GFSF_BYTESIFPOSSIBLE = 0x1,
GFSF_HIDEBYTESCALE = 0x2,
GFSF_DEFAULT = 0
} GETFRIENDLYSIZEFLAGS;
const TCHAR* GetFriendlySize(UINT64 n, unsigned int&fn, GETFRIENDLYSIZEFLAGS f = GFSF_DEFAULT);
class FriendlySize {
const TCHAR* m_s;
unsigned int m_n;
public:
FriendlySize(UINT64 n, size_t f = GFSF_DEFAULT) { Calculate(n, f); }
void Calculate(UINT64 n, size_t f) { m_s = GetFriendlySize(n, m_n, (GETFRIENDLYSIZEFLAGS)f); }
unsigned int UInt() const { return m_n; }
const TCHAR* Scale() const { return m_s; }
};
int sane_system(const TCHAR *command);
void PrintColorFmtMsg(unsigned int type, const TCHAR *fmtstr, va_list args);