ILIAS
release_7 Revision v7.30-3-g800a261c036
|
Public Member Functions | |
__construct (int $size, int $unit) | |
DataSize constructor. More... | |
getSize () | |
The calculated data size. More... | |
getUnit () | |
The unit which equals the class constant used to calculate the data size. More... | |
inBytes () | |
Get the size in bytes. More... | |
__toString () | |
Returns the data size with the corresponding suffix. More... | |
Data Fields | |
const | Byte = 1 |
const | KiB = 1024 |
const | MiB = 1048576 |
const | GiB = 1073741824 |
const | TiB = 1099511627776 |
const | PiB = 1125899906842624 |
const | EiB = 1152921504606846976 |
const | ZiB = 1180591620717411303424 |
const | YiB = 1208925819614629174706176 |
const | KB = 1000 |
const | MB = 1000000 |
const | GB = 1000000000 |
const | TB = 1000000000000 |
const | PB = 1000000000000000 |
const | EB = 1000000000000000000 |
const | ZB = 1000000000000000000000 |
const | YB = 1000000000000000000000000 |
Static Public Attributes | |
static | $abbreviations |
Private Attributes | |
$size | |
$unit | |
$suffix | |
Static Private Attributes | |
static | $suffixMap |
Class DataSize.
This class provides the data size with additional information to remove the work to calculate the size to different unit like GiB, GB usw.
Definition at line 15 of file DataSize.php.
ILIAS\Data\DataSize::__construct | ( | int | $size, |
int | $unit | ||
) |
DataSize constructor.
int | $size | The data size in bytes. |
int | $unit | The unit which is used to calculate the data size. |
Definition at line 126 of file DataSize.php.
References ILIAS\Data\DataSize\$unit.
ILIAS\Data\DataSize::__toString | ( | ) |
Returns the data size with the corresponding suffix.
Example output: 1024 B 4096 GiB
Definition at line 178 of file DataSize.php.
ILIAS\Data\DataSize::getSize | ( | ) |
The calculated data size.
Definition at line 143 of file DataSize.php.
References ILIAS\Data\DataSize\$size.
Referenced by ILIAS\Filesystem\Decorator\ReadOnlyDecorator\getSize(), ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccess\getSize(), ILIAS\Filesystem\FilesystemFacade\getSize(), and ILIAS\Filesystem\Decorator\FilesystemWhitelistDecorator\getSize().
ILIAS\Data\DataSize::getUnit | ( | ) |
The unit which equals the class constant used to calculate the data size.
(self::GiB, ...)
Definition at line 155 of file DataSize.php.
References ILIAS\Data\DataSize\$unit.
ILIAS\Data\DataSize::inBytes | ( | ) |
Get the size in bytes.
Definition at line 163 of file DataSize.php.
References ILIAS\Data\DataSize\$unit.
|
static |
Definition at line 69 of file DataSize.php.
Referenced by ILIAS\Data\Factory\dataSize().
|
private |
Definition at line 106 of file DataSize.php.
Referenced by ILIAS\Data\DataSize\getSize().
|
private |
Definition at line 114 of file DataSize.php.
|
staticprivate |
Definition at line 41 of file DataSize.php.
|
private |
Definition at line 110 of file DataSize.php.
Referenced by ILIAS\Data\DataSize\__construct(), ILIAS\Data\DataSize\getUnit(), and ILIAS\Data\DataSize\inBytes().
const ILIAS\Data\DataSize::Byte = 1 |
Definition at line 17 of file DataSize.php.
Referenced by ILIAS\Filesystem\Finder\Iterator\SizeRangeFilterIterator\__construct().
const ILIAS\Data\DataSize::EB = 1000000000000000000 |
Definition at line 35 of file DataSize.php.
const ILIAS\Data\DataSize::EiB = 1152921504606846976 |
Definition at line 25 of file DataSize.php.
const ILIAS\Data\DataSize::GB = 1000000000 |
Definition at line 32 of file DataSize.php.
const ILIAS\Data\DataSize::GiB = 1073741824 |
Definition at line 22 of file DataSize.php.
Referenced by ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest\testGetSizeWithMissingFileWhichShouldFail().
const ILIAS\Data\DataSize::KB = 1000 |
Definition at line 30 of file DataSize.php.
const ILIAS\Data\DataSize::KiB = 1024 |
Definition at line 20 of file DataSize.php.
Referenced by ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest\testGetSizeWhichShouldSucceed().
const ILIAS\Data\DataSize::MB = 1000000 |
Definition at line 31 of file DataSize.php.
const ILIAS\Data\DataSize::MiB = 1048576 |
Definition at line 21 of file DataSize.php.
Referenced by ILIAS\Filesystem\Provider\FlySystem\FlySystemFileAccessTest\testGetSizeWithUnknownAdapterErrorWhichShouldFail().
const ILIAS\Data\DataSize::PB = 1000000000000000 |
Definition at line 34 of file DataSize.php.
const ILIAS\Data\DataSize::PiB = 1125899906842624 |
Definition at line 24 of file DataSize.php.
const ILIAS\Data\DataSize::TB = 1000000000000 |
Definition at line 33 of file DataSize.php.
const ILIAS\Data\DataSize::TiB = 1099511627776 |
Definition at line 23 of file DataSize.php.
const ILIAS\Data\DataSize::YB = 1000000000000000000000000 |
Definition at line 37 of file DataSize.php.
const ILIAS\Data\DataSize::YiB = 1208925819614629174706176 |
Definition at line 27 of file DataSize.php.
const ILIAS\Data\DataSize::ZB = 1000000000000000000000 |
Definition at line 36 of file DataSize.php.
const ILIAS\Data\DataSize::ZiB = 1180591620717411303424 |
Definition at line 26 of file DataSize.php.