Add missing operators to LittleEndian type

This commit is contained in:
Gary Talent 2018-02-19 21:05:00 -06:00
parent 21e72a0513
commit cd38c961a3

View File

@ -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;
}
};
}