CatapultServer  v0.5.0.1 (Elephant)
catapult::utils::FileSize Class Referencefinal

Represents a file size. More...

Public Member Functions

constexpr FileSize ()
 Creates a default (zero) file size. More...
 
constexpr uint64_t megabytes () const
 Returns the number of megabytes. More...
 
constexpr uint64_t kilobytes () const
 Returns the number of kilobytes. More...
 
constexpr uint64_t bytes () const
 Returns the number of bytes. More...
 
uint32_t bytes32 () const
 Returns the number of bytes as a uint32_t. More...
 
constexpr bool operator== (const FileSize &rhs) const
 Returns true if this file size is equal to rhs. More...
 
constexpr bool operator!= (const FileSize &rhs) const
 Returns true if this file size is not equal to rhs. More...
 
constexpr bool operator>= (const FileSize &rhs) const
 Returns true if this file size is greater than or equal to rhs. More...
 
constexpr bool operator> (const FileSize &rhs) const
 Returns true if this file size is greater than rhs. More...
 
constexpr bool operator<= (const FileSize &rhs) const
 Returns true if this file size is less than or equal to rhs. More...
 
constexpr bool operator< (const FileSize &rhs) const
 Returns true if this file size is less than rhs. More...
 

Static Public Member Functions

static constexpr FileSize FromMegabytes (uint64_t megabytes)
 Creates a file size from the given number of megabytes. More...
 
static constexpr FileSize FromKilobytes (uint64_t kilobytes)
 Creates a file size from the given number of kilobytes. More...
 
static constexpr FileSize FromBytes (uint64_t bytes)
 Creates a file size from the given number of bytes. More...
 

Private Member Functions

constexpr FileSize (uint64_t bytes)
 

Private Attributes

uint64_t m_bytes
 

Detailed Description

Represents a file size.

Constructor & Destructor Documentation

◆ FileSize() [1/2]

constexpr catapult::utils::FileSize::FileSize ( uint64_t  bytes)
inlineexplicitconstexprprivate

◆ FileSize() [2/2]

constexpr catapult::utils::FileSize::FileSize ( )
inlineconstexpr

Creates a default (zero) file size.

Here is the caller graph for this function:

Member Function Documentation

◆ bytes()

constexpr uint64_t catapult::utils::FileSize::bytes ( ) const
inlineconstexpr

Returns the number of bytes.

Here is the caller graph for this function:

◆ bytes32()

uint32_t catapult::utils::FileSize::bytes32 ( ) const
inline

Returns the number of bytes as a uint32_t.

Here is the caller graph for this function:

◆ FromBytes()

static constexpr FileSize catapult::utils::FileSize::FromBytes ( uint64_t  bytes)
inlinestaticconstexpr

Creates a file size from the given number of bytes.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromKilobytes()

static constexpr FileSize catapult::utils::FileSize::FromKilobytes ( uint64_t  kilobytes)
inlinestaticconstexpr

Creates a file size from the given number of kilobytes.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FromMegabytes()

static constexpr FileSize catapult::utils::FileSize::FromMegabytes ( uint64_t  megabytes)
inlinestaticconstexpr

Creates a file size from the given number of megabytes.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ kilobytes()

constexpr uint64_t catapult::utils::FileSize::kilobytes ( ) const
inlineconstexpr

Returns the number of kilobytes.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ megabytes()

constexpr uint64_t catapult::utils::FileSize::megabytes ( ) const
inlineconstexpr

Returns the number of megabytes.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator!=()

constexpr bool catapult::utils::FileSize::operator!= ( const FileSize rhs) const
inlineconstexpr

Returns true if this file size is not equal to rhs.

◆ operator<()

constexpr bool catapult::utils::FileSize::operator< ( const FileSize rhs) const
inlineconstexpr

Returns true if this file size is less than rhs.

◆ operator<=()

constexpr bool catapult::utils::FileSize::operator<= ( const FileSize rhs) const
inlineconstexpr

Returns true if this file size is less than or equal to rhs.

◆ operator==()

constexpr bool catapult::utils::FileSize::operator== ( const FileSize rhs) const
inlineconstexpr

Returns true if this file size is equal to rhs.

◆ operator>()

constexpr bool catapult::utils::FileSize::operator> ( const FileSize rhs) const
inlineconstexpr

Returns true if this file size is greater than rhs.

◆ operator>=()

constexpr bool catapult::utils::FileSize::operator>= ( const FileSize rhs) const
inlineconstexpr

Returns true if this file size is greater than or equal to rhs.

Member Data Documentation

◆ m_bytes

uint64_t catapult::utils::FileSize::m_bytes
private

The documentation for this class was generated from the following file: