Enumerations

enum class SizeUnit : char
Name Value Comments
kAuto 0

Automatically select an appropriate unit.

kBytes 'B' --
kKiB 'K' --
kMiB 'M' --
kGiB 'G' --
kTiB 'T' --
kPiB 'P' --
kEiB 'E' --

Units for formatting byte sizes.

Defined at line 21 of file ../../zircon/system/ulib/pretty/include/pretty/cpp/sizes.h

Records

Functions

  • std::optional<uint64_t> ParseSizeBytes (std::string_view formatted_bytes)

    Returns the number of bytes represented by a human readable string

    like "123.4k", 123.4 * 1024 bytes encoded in |formatted_bytes|.

    If |formatted_bytes| is not correctly formatted then |std::nullopt| is returned.

    This is a reverse function of |format_size| input |bytes|. Except that it considers

    absence of unit (e.g. "123") to be in bytes(implicit B).

    Defined at line 122 of file ../../zircon/system/ulib/pretty/sizes.cc

  • std::optional<uint64_t> ParseSizeBytes (std::string_view formatted_bytes)

    Returns the number of bytes represented by a human readable string

    like "123.4k", 123.4 * 1024 bytes encoded in |formatted_bytes|.

    If |formatted_bytes| is not correctly formatted then |std::nullopt| is returned.

    This is a reverse function of |format_size| input |bytes|. Except that it considers

    absence of unit (e.g. "123") to be in bytes(implicit B).

    Defined at line 122 of file ../../zircon/system/ulib/pretty/sizes.cc