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.
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "IxSerDes.h"
|
|
|
|
|
#include "Defines.h"
|
|
|
|
|
#include "mProjectManager_global.h"
|
|
|
|
|
|
|
|
|
|
class ZxDataProject;
|
|
|
|
|
class M_PROJECTMANAGER_EXPORT mProjectFile : public QObject,
|
|
|
|
|
virtual public IxSerDes
|
|
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
mProjectFile();
|
|
|
|
|
mProjectFile(ZxDataProject* p);
|
|
|
|
|
~mProjectFile();
|
|
|
|
|
|
|
|
|
|
virtual void onSerialize(ZxSerializer* ser);
|
|
|
|
|
virtual void onDeserialize(ZxSerializer* ser);
|
|
|
|
|
|
|
|
|
|
static bool parseProjUrl(QString s, QString& sDir, QString& sProjName);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
// sFullPathFile 指的是,自定义格式的文件,非db文件
|
|
|
|
|
|
|
|
|
|
bool save(ZxDataProject* p, bool ignoreIfExists = true);
|
|
|
|
|
bool save(QString sDir, QString sName, bool ignoreIfExists = true);
|
|
|
|
|
bool save(QString sFullPathFile, bool ignoreIfExists = true);
|
|
|
|
|
|
|
|
|
|
bool load(ZxDataProject* p);
|
|
|
|
|
bool load(QString sDir, QString sName);
|
|
|
|
|
bool load(QString sFullPathFile);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
|
|
bool makesureDbUrl(QString sFullPathFile, bool bLoad);
|
|
|
|
|
|
|
|
|
|
bool saveProj(QString sProj);
|
|
|
|
|
bool loadProj(QString sProj);
|
|
|
|
|
|
|
|
|
|
void initByProj(ZxDataProject* p);
|
|
|
|
|
|
|
|
|
|
QString getWtjFile(ZxDataProject* p);
|
|
|
|
|
QString getWtjFile(QString sDir, QString sName, QString sExt = "wtf");
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
|
|
ZxDataProject* m_pDataProject; //设置的Obj
|
|
|
|
|
QString m_sProjName;
|
|
|
|
|
QString m_sDbUrl;
|
|
|
|
|
};
|