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.

54 lines
1.2 KiB
C++

#ifndef NBTMODIFIER_ABSTRACTNAMEDTAG_H
#define NBTMODIFIER_ABSTRACTNAMEDTAG_H
#include "AbstractTag.h"
#include <QtCore/QString>
class AbstractNamedTag : public AbstractTag {
public:
/**
* Get the tag name
*
* @return The tag name
*/
const QString& name() const;
/**
* Set the tag name
*
* @param name The new tag name
*/
void setName (const QString &name);
protected:
explicit AbstractNamedTag(const quint8 id);
virtual const bool readFromData(QDataStream &data) override;
virtual const bool writeToData(QDataStream &data) const override;
/**
* Read a tag payload from a data stream
*
* @param data The data stream
*
* @return True if read is success, otherwise false
*/
virtual const bool readPayloadFromData(QDataStream &data) = 0;
/**
* Write a tag payload to a data stream
*
* @param data The data stream
*
* @return True if write is success, otherwise false
*/
virtual const bool writePayloadToData(QDataStream &data) const = 0;
private:
/**
* The tag name
*/
QString m_name;
};
#endif //NBTMODIFIER_ABSTRACTNAMEDTAG_H