Add missing operators to LittleEndian type
This commit is contained in:
parent
21e72a0513
commit
cd38c961a3
54
deps/ox/src/ox/std/byteswap.hpp
vendored
54
deps/ox/src/ox/std/byteswap.hpp
vendored
@ -171,6 +171,60 @@ class LittleEndian {
|
||||
return old;
|
||||
}
|
||||
|
||||
inline T operator~() {
|
||||
return ~ox::bigEndianAdapt(m_value);
|
||||
}
|
||||
|
||||
inline T operator&(T value) {
|
||||
return ox::bigEndianAdapt(m_value) & value;
|
||||
}
|
||||
|
||||
inline T operator&=(T other) {
|
||||
auto newVal = *this & other;
|
||||
m_value = ox::bigEndianAdapt(newVal);
|
||||
return newVal;
|
||||
}
|
||||
|
||||
inline T operator|(T value) {
|
||||
return ox::bigEndianAdapt(m_value) | value;
|
||||
}
|
||||
|
||||
inline T operator|=(T other) {
|
||||
auto newVal = *this | other;
|
||||
m_value = ox::bigEndianAdapt(newVal);
|
||||
return newVal;
|
||||
}
|
||||
|
||||
inline T operator^(T value) {
|
||||
return ox::bigEndianAdapt(m_value) ^ value;
|
||||
}
|
||||
|
||||
inline T operator^=(T other) {
|
||||
auto newVal = *this ^ other;
|
||||
m_value = ox::bigEndianAdapt(newVal);
|
||||
return newVal;
|
||||
}
|
||||
|
||||
inline T operator>>(T value) {
|
||||
return ox::bigEndianAdapt(m_value) >> value;
|
||||
}
|
||||
|
||||
inline T operator>>=(T other) {
|
||||
auto newVal = *this >> other;
|
||||
m_value = ox::bigEndianAdapt(newVal);
|
||||
return newVal;
|
||||
}
|
||||
|
||||
inline T operator<<(T value) {
|
||||
return ox::bigEndianAdapt(m_value) << value;
|
||||
}
|
||||
|
||||
inline T operator<<=(T other) {
|
||||
auto newVal = *this << other;
|
||||
m_value = ox::bigEndianAdapt(newVal);
|
||||
return newVal;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user