class FormattedBytes
Defined at line 40 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
FormattedBytes is an inline buffer suitable for containing formatted byte
sizes.
Typical usage is as follows:
printf("Free memory: %s\n", FormattedBytes(12345).str());
See `format_size` and `format_size_fixed` in
<pretty
/sizes.h> for details.
Public Methods
void FormattedBytes ()
Construct an empty string.
Defined at line 43 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
void FormattedBytes (size_t size)
Construct a string representing the given size.
Chooses an appropriate unit ('k', 'M', etc) based on the size.
Defined at line 48 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
void FormattedBytes (size_t size)
Construct a string representing the given size.
Chooses an appropriate unit ('k', 'M', etc) based on the size.
Defined at line 48 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
void FormattedBytes (size_t size)
Construct a string representing the given size.
Chooses an appropriate unit ('k', 'M', etc) based on the size.
Defined at line 48 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
void FormattedBytes (size_t size, SizeUnit unit)
Construct a string representing the given size, using the given units.
Defined at line 51 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
void FormattedBytes (size_t size, SizeUnit unit)
Construct a string representing the given size, using the given units.
Defined at line 51 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
void FormattedBytes (size_t size, SizeUnit unit)
Construct a string representing the given size, using the given units.
Defined at line 51 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
void FormattedBytes (const FormattedBytes & )
Default copy operators.
Defined at line 54 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
FormattedBytes & operator= (const FormattedBytes & )
Defined at line 55 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
FormattedBytes & SetSize (size_t size)
Update the string to the given size.
Defined at line 58 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
FormattedBytes & SetSize (size_t size)
Update the string to the given size.
Defined at line 58 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
FormattedBytes & SetSize (size_t size)
Update the string to the given size.
Defined at line 58 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
FormattedBytes & SetSize (size_t size, SizeUnit unit)
Defined at line 62 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
FormattedBytes & SetSize (size_t size, SizeUnit unit)
Defined at line 62 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
FormattedBytes & SetSize (size_t size, SizeUnit unit)
Defined at line 62 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
std::string_view str ()
Return the formatted string.
Defined at line 68 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
const char * c_str ()
Return the formatted string as a C-style NUL-terminated string.
Defined at line 71 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
std::string_view Magnitude ()
Returns the formatted magnitude as a string.
Defined at line 74 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h
SizeUnit Unit ()
Returns the associated SizeUnit. In the case of the empty string, kAuto
is returned.
Defined at line 82 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h