StormByte 3.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/safe/hash.hxx>
#include <StormByte/safe/string.hxx>
#include <StormByte/safe/wstring.hxx>
#include <StormByte/size.hxx>
#include <StormByte/type_traits.hxx>
#include <StormByte/visibility.h>
#include <cassert>
#include <compare>
#include <cstddef>
#include <cstdint>
#include <limits>
#include <ostream>
#include <span>
#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...
struct  StormByte::Safe::Hash< StormByte::ByteSize >
class  std::numeric_limits< StormByte::ByteSize >
 Limits of StormByte::ByteSize. More...
struct  std::hash< StormByte::ByteSize >

Namespaces

namespace  StormByte
 Root namespace of the StormByte suite.

Functions

template<Type::Integral T>
constexpr bool StormByte::operator== (ByteSize lhs, T rhs)
 Mixed equality.
template<Type::Integral T>
constexpr bool StormByte::operator== (T lhs, ByteSize rhs)
 Mixed equality.
template<Type::Integral T>
constexpr ByteSize StormByte::operator+ (ByteSize lhs, T rhs)
 Mixed sum.
template<Type::Integral T>
constexpr ByteSize StormByte::operator+ (T lhs, ByteSize rhs)
 Mixed sum.
template<Type::Integral T>
constexpr ByteSize StormByte::operator- (ByteSize lhs, T rhs)
 Mixed difference.
template<Type::Integral T>
constexpr ByteSize StormByte::operator- (T lhs, ByteSize rhs)
 Mixed difference.
template<Type::Integral T>
constexpr ByteSize StormByte::operator* (ByteSize lhs, T rhs)
 Mixed product.
template<Type::Integral T>
constexpr ByteSize StormByte::operator* (T lhs, ByteSize rhs)
 Mixed product.
template<Type::Integral T>
constexpr ByteSize StormByte::operator/ (ByteSize lhs, T rhs)
 Mixed quotient.
template<Type::Integral T>
constexpr ByteSize StormByte::operator% (ByteSize lhs, T rhs)
 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.