C# Class PathLib.FileSize

Represents the size of a particular file.
显示文件 Open project: nemec/pathlib

Public Methods

Method Description
Equals ( object obj ) : bool
FileSize ( long bytes ) : System

Represents the size of a particular file.

GetHashCode ( ) : int
ToSIUnits ( ) : FileSize

Returns the file size represented in multiples of 1000.

ToString ( ) : string

Convert to a string using the closest "round" units.

ToString ( FileSizeUnits units, bool useUnambiguousPrefixes = false ) : string

Returns the string using the given units.

Private Methods

Method Description
FileSize ( long bytes, FileSizeScale scale ) : System

Represents the size of a particular file.

GetAs ( FileSizeUnits units ) : long
GetAsFraction ( FileSizeUnits units ) : double

Method Details

Equals() public method

public Equals ( object obj ) : bool
obj object
return bool

FileSize() public method

Represents the size of a particular file.
public FileSize ( long bytes ) : System
bytes long
return System

GetHashCode() public method

public GetHashCode ( ) : int
return int

ToSIUnits() public method

Returns the file size represented in multiples of 1000.
public ToSIUnits ( ) : FileSize
return FileSize

ToString() public method

Convert to a string using the closest "round" units.
public ToString ( ) : string
return string

ToString() public method

Returns the string using the given units.
public ToString ( FileSizeUnits units, bool useUnambiguousPrefixes = false ) : string
units FileSizeUnits
useUnambiguousPrefixes bool /// Use the new IEC prefixes for binary units (kibibytes-KiB, /// mebibytes-MiB, etc.) instead of the more common units. ///
return string