mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +00:00
AK: Add formatters for BigEndian and LittleEndian
This allows printing out BigEndian and LittleEndian values without having to perform a static_cast first.
This commit is contained in:
parent
0990c23fc3
commit
05c3755e62
1 changed files with 9 additions and 0 deletions
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <AK/Format.h>
|
||||||
#include <AK/Forward.h>
|
#include <AK/Forward.h>
|
||||||
#include <AK/Platform.h>
|
#include <AK/Platform.h>
|
||||||
|
|
||||||
|
@ -134,6 +135,14 @@ private:
|
||||||
template<typename T>
|
template<typename T>
|
||||||
using NetworkOrdered = BigEndian<T>;
|
using NetworkOrdered = BigEndian<T>;
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
requires(HasFormatter<T>) struct Formatter<LittleEndian<T>> : Formatter<T> {
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename T>
|
||||||
|
requires(HasFormatter<T>) struct Formatter<BigEndian<T>> : Formatter<T> {
|
||||||
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
using AK::BigEndian;
|
using AK::BigEndian;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue