filesizes.filesize

Contains all basic filesize functions.

Members

Classes

FilesizeParseException
class FilesizeParseException

Exception that's thrown when a filesize component cannot be parsed from a string.

Enums

Size
enum Size

Enumeration of various valid filesize denominations.

Functions

formatFilesize
string formatFilesize(string formatString, ulong byteSize, bool useAbbreviation, bool useMetric)
Undocumented in source. Be warned that the author may not have intended to support it.
formatFilesize
string formatFilesize(ulong byteSize, bool useAbbreviation, bool useMetric)
Undocumented in source. Be warned that the author may not have intended to support it.
formatFilesize
string formatFilesize(string formatString, ulong byteSize, SizeDenomination size, bool useAbbreviation)

Produces a formatted filesize string for the given number of bytes and a size denomination.

getAppropriateSize
Size getAppropriateSize(ulong byteSize, bool useMetric)

Determines the best size denomination to use to describe the given byte size.

parseDenomination
Size parseDenomination(string s)

Parses a filesize unit denomination from a string, such as "bytes", "kilobyte", or "tibibytes".

parseFilesize
ulong parseFilesize(string s)

Parses a filesize from a string that's formatted like so: "<number> <unit>", where the unit is any one of the defined Size types. Accepts floating-point and integer numbers.

Structs

SizeDenomination
struct SizeDenomination

Represents the properties of a particular filesize denomination.

Meta