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.
nmWATI/Include/mData/mProjectManager/mProjectFile.h

56 lines
1.3 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

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