MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
storage.hpp
Go to the documentation of this file.
1
/*
2
3
Copyright 2025 Matthew Tolman
4
5
Licensed under the Apache License, Version 2.0 (the "License");
6
you may not use this file except in compliance with the License.
7
You may obtain a copy of the License at
8
9
http://www.apache.org/licenses/LICENSE-2.0
10
11
Unless required by applicable law or agreed to in writing, software
12
distributed under the License is distributed on an "AS IS" BASIS,
13
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
See the License for the specific language governing permissions and
15
limitations under the License.
16
17
*/
18
19
#ifndef MTCORE_UNITS_STORAGE_HPP
20
#define MTCORE_UNITS_STORAGE_HPP
21
22
#include "
mtcore/math/templates.hpp
"
23
#include "
mtcore/units/base.hpp
"
24
25
namespace
mtcore::units
{
26
namespace
storage
{
27
constexpr
auto
byte
=
Units<Unit<dimensions::STORAGE>
>{};
28
constexpr
auto
decabyte
=
Units<Unit<dimensions::STORAGE, std::deca>
>{};
29
constexpr
auto
hectobyte
=
Units<Unit<dimensions::STORAGE, std::hecto>
>{};
30
constexpr
auto
kilobyte
=
Units<Unit<dimensions::STORAGE, std::kilo>
>{};
31
constexpr
auto
megabyte
=
Units<Unit<dimensions::STORAGE, std::mega>
>{};
32
constexpr
auto
gigabyte
=
Units<Unit<dimensions::STORAGE, std::giga>
>{};
33
constexpr
auto
terabyte
=
Units<Unit<dimensions::STORAGE, std::tera>
>{};
34
constexpr
auto
petabyte
=
Units<Unit<dimensions::STORAGE, std::peta>
>{};
35
constexpr
auto
exabyte
=
Units<Unit<dimensions::STORAGE, std::exa>
>{};
36
37
constexpr
auto
bit
=
Units<Unit<dimensions::STORAGE, std::ratio<1, 8>
>>{};
38
constexpr
auto
decabit
=
Units<Unit<dimensions::STORAGE, math::MultRatios<std::ratio<1, 8>
, std::deca>::T>>{};
39
constexpr
auto
hectobit
=
Units<Unit<dimensions::STORAGE, math::MultRatios<std::ratio<1, 8>
, std::hecto>::T>>{};
40
constexpr
auto
kilobit
=
Units<Unit<dimensions::STORAGE, math::MultRatios<std::ratio<1, 8>
, std::kilo>::T>>{};
41
constexpr
auto
megabit
=
Units<Unit<dimensions::STORAGE, math::MultRatios<std::ratio<1, 8>
, std::mega>::T>>{};
42
constexpr
auto
gigabit
=
Units<Unit<dimensions::STORAGE, math::MultRatios<std::ratio<1, 8>
, std::giga>::T>>{};
43
constexpr
auto
terabit
=
Units<Unit<dimensions::STORAGE, math::MultRatios<std::ratio<1, 8>
, std::tera>::T>>{};
44
constexpr
auto
petabit
=
Units<Unit<dimensions::STORAGE, math::MultRatios<std::ratio<1, 8>
, std::peta>::T>>{};
45
constexpr
auto
exabit
=
Units<Unit<dimensions::STORAGE, math::MultRatios<std::ratio<1, 8>
, std::exa>::T>>{};
46
}
47
48
MTCORE_DEF_UNIT_NAME
(storage,
byte
, B)
49
MTCORE_DEF_UNIT_NAME
(storage, bit, b)
50
MTCORE_DEF_UNIT_NAME
(storage, exabyte, EB)
51
MTCORE_DEF_UNIT_NAME
(storage, exabit, Eb)
52
MTCORE_DEF_UNIT_NAME_SI_PREFIXES_LARGE
(storage,
byte
,
byte
, B)
53
MTCORE_DEF_UNIT_NAME_SI_PREFIXES_LARGE
(storage, bit, bit, b)
54
}
55
#endif
//MTCORE_UNITS_STORAGE_HPP
mtcore::units::storage
Definition
storage.hpp:26
mtcore::units::storage::gigabit
constexpr auto gigabit
Definition
storage.hpp:42
mtcore::units::storage::bit
constexpr auto bit
Definition
storage.hpp:37
mtcore::units::storage::decabyte
constexpr auto decabyte
Definition
storage.hpp:28
mtcore::units::storage::terabyte
constexpr auto terabyte
Definition
storage.hpp:33
mtcore::units::storage::kilobyte
constexpr auto kilobyte
Definition
storage.hpp:30
mtcore::units::storage::megabyte
constexpr auto megabyte
Definition
storage.hpp:31
mtcore::units::storage::kilobit
constexpr auto kilobit
Definition
storage.hpp:40
mtcore::units::storage::decabit
constexpr auto decabit
Definition
storage.hpp:38
mtcore::units::storage::gigabyte
constexpr auto gigabyte
Definition
storage.hpp:32
mtcore::units::storage::hectobit
constexpr auto hectobit
Definition
storage.hpp:39
mtcore::units::storage::exabit
constexpr auto exabit
Definition
storage.hpp:45
mtcore::units::storage::petabit
constexpr auto petabit
Definition
storage.hpp:44
mtcore::units::storage::exabyte
constexpr auto exabyte
Definition
storage.hpp:35
mtcore::units::storage::terabit
constexpr auto terabit
Definition
storage.hpp:43
mtcore::units::storage::petabyte
constexpr auto petabyte
Definition
storage.hpp:34
mtcore::units::storage::hectobyte
constexpr auto hectobyte
Definition
storage.hpp:29
mtcore::units::storage::megabit
constexpr auto megabit
Definition
storage.hpp:41
mtcore::units
Base namespace for units.
Definition
angle.hpp:24
mtcore::units::Units
List of units.
Definition
units/base.hpp:80
templates.hpp
base.hpp
MTCORE_DEF_UNIT_NAME_SI_PREFIXES_LARGE
#define MTCORE_DEF_UNIT_NAME_SI_PREFIXES_LARGE(NS, UNIT, US_NAME, ABBREV)
Definition
units/base.hpp:957
MTCORE_DEF_UNIT_NAME
#define MTCORE_DEF_UNIT_NAME(NS, UNIT, ABBREV)
Definition
units/base.hpp:915
include
core
mtcore
units
storage.hpp
Generated on Wed Jun 11 2025 16:20:21 for MT Core (C++) by
1.13.2