OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_BASE_TEXT_BYTES_FORMATTING_H_ | 5 #ifndef UI_BASE_TEXT_BYTES_FORMATTING_H_ |
6 #define UI_BASE_TEXT_BYTES_FORMATTING_H_ | 6 #define UI_BASE_TEXT_BYTES_FORMATTING_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "ui/base/ui_export.h" | 10 #include "ui/base/ui_export.h" |
11 | 11 |
12 namespace ui { | 12 namespace ui { |
13 | 13 |
14 // Simple API ------------------------------------------------------------------ | 14 // Simple API ------------------------------------------------------------------ |
15 | 15 |
16 // Simple call to return a byte quantity as a string in human-readable format. | 16 // Simple call to return a byte quantity as a string in human-readable format. |
17 // Ex: FormatBytes(512) => "512 B" | 17 // Ex: FormatBytes(512) => "512 B" |
18 // Ex: FormatBytes(101479) => "99.1 kB" | 18 // Ex: FormatBytes(101479) => "99.1 kB" |
19 UI_EXPORT string16 FormatBytes(int64 bytes); | 19 UI_EXPORT string16 FormatBytes(int64 bytes); |
(...skipping 27 matching lines...) Expand all Loading... |
47 bool show_units); | 47 bool show_units); |
48 | 48 |
49 // As above, but with "/s" units for speed values. | 49 // As above, but with "/s" units for speed values. |
50 // Ex: FormatSpeed(512, DATA_UNITS_KIBIBYTE, true) => "0.5 kB/s" | 50 // Ex: FormatSpeed(512, DATA_UNITS_KIBIBYTE, true) => "0.5 kB/s" |
51 // Ex: FormatSpeed(10*1024, DATA_UNITS_MEBIBYTE, false) => "0.1" | 51 // Ex: FormatSpeed(10*1024, DATA_UNITS_MEBIBYTE, false) => "0.1" |
52 string16 FormatSpeedWithUnits(int64 bytes, DataUnits units, bool show_units); | 52 string16 FormatSpeedWithUnits(int64 bytes, DataUnits units, bool show_units); |
53 | 53 |
54 } // namespace ui | 54 } // namespace ui |
55 | 55 |
56 #endif // UI_BASE_TEXT_BYTES_FORMATTING_H_ | 56 #endif // UI_BASE_TEXT_BYTES_FORMATTING_H_ |
OLD | NEW |