source: filezilla/trunk/fuentes/src/include/sizeformatting_base.h @ 130

Last change on this file since 130 was 130, checked in by jrpelegrina, 3 years ago

First release to xenial

File size: 1.1 KB
Line 
1#ifndef __SIZEFORMATTING_BASE_H__
2#define __SIZEFORMATTING_BASE_H__
3
4class COptionsBase;
5class CSizeFormatBase
6{
7public:
8        enum _format
9        {
10                bytes,
11                iec,
12                si1024,
13                si1000,
14
15                formats_count
16        };
17
18        // We stop at Exa. If someone has files bigger than that, he can afford to
19        // make a donation to have this changed ;)
20        enum _unit
21        {
22                byte,
23                kilo,
24                mega,
25                giga,
26                tera,
27                peta,
28                exa
29        };
30
31        static wxString FormatNumber(COptionsBase* pOptions, int64_t size, bool* thousands_separator = 0);
32
33        static wxString GetUnitWithBase(COptionsBase* pOptions, _unit unit, int base);
34        static wxString GetUnit(COptionsBase* pOptions, _unit unit, _format = formats_count);
35        static wxString FormatUnit(COptionsBase* pOptions, int64_t size, _unit unit, int base = 1024);
36
37        static wxString Format(COptionsBase* pOptions, int64_t size, bool add_bytes_suffix, _format format, bool thousands_separator, int num_decimal_places);
38        static wxString Format(COptionsBase* pOptions, int64_t size, bool add_bytes_suffix = false);
39
40        static const wxString& GetThousandsSeparator();
41        static const wxString& GetRadixSeparator();
42};
43
44#endif //__SIZEFORMATTING_BASE_H__
Note: See TracBrowser for help on using the repository browser.