StormByte 2.0.0
C++26 foundation of the StormByte suite
 
Loading...
Searching...
No Matches
byte_size.hxx File Reference

IEC octet length (uint64_t), implicit only to std::size_t. More...

#include <StormByte/cstring.hxx>
#include <StormByte/size.hxx>
#include <StormByte/type_traits.hxx>
#include <StormByte/visibility.h>
#include <StormByte/wcstring.hxx>
#include <cassert>
#include <compare>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <ostream>
#include <string>
#include <type_traits>
#include <utility>
Include dependency graph for byte_size.hxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  StormByte::ByteSize
 Count of octets (uint64_t storage). More...
 
struct  StormByte::ByteSize::Unit
 One-octet scale used by the named factories. More...
 

Namespaces

namespace  StormByte
 Root namespace of the StormByte suite.
 

Functions

template<Type::Integral T>
constexpr bool StormByte::operator== (ByteSize lhs, T rhs) noexcept
 Mixed equality.
 
template<Type::Integral T>
constexpr bool StormByte::operator== (T lhs, ByteSize rhs) noexcept
 Mixed equality.
 
template<Type::Integral T>
constexpr std::strong_ordering StormByte::operator<=> (ByteSize lhs, T rhs) noexcept
 Mixed order.
 
template<Type::Integral T>
constexpr std::strong_ordering StormByte::operator<=> (T lhs, ByteSize rhs) noexcept
 Mixed order.
 
template<Type::Integral T>
constexpr ByteSize StormByte::operator+ (ByteSize lhs, T rhs) noexcept
 Mixed sum.
 
template<Type::Integral T>
constexpr ByteSize StormByte::operator+ (T lhs, ByteSize rhs) noexcept
 Mixed sum.
 
template<Type::Integral T>
constexpr ByteSize StormByte::operator- (ByteSize lhs, T rhs) noexcept
 Mixed difference.
 
template<Type::Integral T>
constexpr ByteSize StormByte::operator- (T lhs, ByteSize rhs) noexcept
 Mixed difference.
 
template<Type::Integral T>
constexpr ByteSize StormByte::operator* (ByteSize lhs, T rhs) noexcept
 Mixed product.
 
template<Type::Integral T>
constexpr ByteSize StormByte::operator* (T lhs, ByteSize rhs) noexcept
 Mixed product.
 
template<Type::Integral T>
constexpr ByteSize StormByte::operator/ (ByteSize lhs, T rhs) noexcept
 Mixed quotient.
 
template<Type::Integral T>
constexpr ByteSize StormByte::operator% (ByteSize lhs, T rhs) noexcept
 Mixed remainder.
 
std::ostream & StormByte::operator<< (std::ostream &stream, ByteSize size)
 Writes the IEC human-readable length.
 

Variables

constexpr ByteSize StormByte::B {1ull}
 One octet.
 
constexpr ByteSize StormByte::KiB {1024ull}
 2^10 octets.
 
constexpr ByteSize StormByte::MiB {1024ull * 1024}
 2^20 octets.
 
constexpr ByteSize StormByte::GiB {1024ull * 1024 * 1024}
 2^30 octets.
 
constexpr ByteSize StormByte::TiB {1024ull * 1024 * 1024 * 1024}
 2^40 octets.
 
constexpr ByteSize StormByte::PiB {1024ull * 1024 * 1024 * 1024 * 1024}
 2^50 octets.
 
constexpr ByteSize StormByte::EiB {1024ull * 1024 * 1024 * 1024 * 1024 * 1024}
 2^60 octets.
 
constexpr ByteSize StormByte::KB {1000ull}
 10^3 octets.
 
constexpr ByteSize StormByte::MB {1000ull * 1000}
 10^6 octets.
 
constexpr ByteSize StormByte::GB {1000ull * 1000 * 1000}
 10^9 octets.
 
constexpr ByteSize StormByte::TB {1000ull * 1000 * 1000 * 1000}
 10^12 octets.
 
constexpr ByteSize StormByte::PB {1000ull * 1000 * 1000 * 1000 * 1000}
 10^15 octets.
 
constexpr ByteSize StormByte::EB {1000ull * 1000 * 1000 * 1000 * 1000 * 1000}
 10^18 octets.
 

Detailed Description

IEC octet length (uint64_t), implicit only to std::size_t.