You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
704 B
C++
28 lines
704 B
C++
#include "AbstractNumeric.h"
|
|
|
|
#include <QtEndian>
|
|
#include <QtCore/QDataStream>
|
|
|
|
template<typename T>
|
|
NBT::Payload::AbstractNumeric<T>::AbstractNumeric (T const value): m_value(value) {
|
|
}
|
|
|
|
template<typename T>
|
|
const T NBT::Payload::AbstractNumeric<T>::value () const {
|
|
return m_value;
|
|
}
|
|
template<typename T>
|
|
void NBT::Payload::AbstractNumeric<T>::setValue (T const value) {
|
|
m_value = value;
|
|
}
|
|
|
|
template<typename T>
|
|
void NBT::Payload::AbstractNumeric<T>::readFromData (QDataStream &stream) {
|
|
stream >> m_value;
|
|
m_value = qFromBigEndian(m_value);
|
|
}
|
|
template<typename T>
|
|
void NBT::Payload::AbstractNumeric<T>::writeToData (QDataStream &stream) const {
|
|
stream << qToBigEndian(m_value);
|
|
}
|