initial port for Cevo game in C++ (libs)
This commit is contained in:
commit
8436242032
375 files changed
+46282
No files matched your search
@@ -0,0 +1,38 @@
|
||||
#pragma once
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
namespace Cevo {
|
||||
|
||||
// Equivalent of DataFile.pas's TDataFile: a base for serializable data
|
||||
// objects (subclasses implement the actual load/save logic).
|
||||
class DataFile : public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit DataFile(QObject *parent = nullptr);
|
||||
|
||||
virtual QString fileExt() const { return QStringLiteral(".dat"); }
|
||||
// Equivalent of GetFileName: a human-readable type name (used to build
|
||||
// the default file name), NOT the stored path - see fileName()/setFileName().
|
||||
virtual QString fileTypeName() const;
|
||||
virtual QString fileFilter() const;
|
||||
virtual void assign(const DataFile &source);
|
||||
virtual void loadFromFile(const QString &newFileName);
|
||||
virtual void saveToFile(const QString &newFileName);
|
||||
|
||||
QString fileName() const { return m_fileName; }
|
||||
void setFileName(const QString &value) { m_fileName = value; }
|
||||
|
||||
bool modified() const { return m_modified; }
|
||||
void setModified(bool value);
|
||||
|
||||
signals:
|
||||
void modifiedChanged();
|
||||
|
||||
private:
|
||||
QString m_fileName;
|
||||
bool m_modified = false;
|
||||
};
|
||||
|
||||
} // namespace Cevo
|
||||
Reference in new issue
Block a user