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.
72 lines
1.5 KiB
C++
72 lines
1.5 KiB
C++
|
|
#pragma once
|
|
|
|
#include "ZxXpfNode.h"
|
|
|
|
class QFile;
|
|
|
|
// XPF文件格式Doc根节点
|
|
class I_BASE_EXPORT ZxXpfDoc : public ZxXpfNode
|
|
{
|
|
public:
|
|
|
|
ZxXpfDoc(const QString& sRootNodeName = QString());
|
|
|
|
// 加载
|
|
bool load(const QString& path);
|
|
bool load(QFile& file);
|
|
bool load(QDataStream& stream);
|
|
|
|
// 保存
|
|
bool save(const QString& path);
|
|
bool save(QFile& file);
|
|
bool save(QDataStream& stream);
|
|
|
|
// Xpf版本号
|
|
quint32 getXpfVer() const;
|
|
|
|
// 应用层的文件版本号.
|
|
quint32 getDocVer() const;
|
|
void setDocVer(quint32 nVersion);
|
|
|
|
// 8位数日期
|
|
quint32 getDocDate() const;
|
|
void setDocDate(quint32 nDate);
|
|
|
|
// 文档类型
|
|
QString getDocType() const;
|
|
void setDocType(const QString& sDocType);
|
|
|
|
// 文档标识
|
|
quint32 getDocFlags() const;
|
|
void setDocFlags(quint32 flags, bool bSet);
|
|
|
|
// 加载
|
|
bool loadTree(QDataStream& stream);
|
|
bool loadHeader(QDataStream& stream);
|
|
bool loadHeader_New(QDataStream& stream);
|
|
bool loadHeader_Old(QDataStream& stream);
|
|
|
|
// 保存
|
|
bool saveHeader(QDataStream& stream);
|
|
bool saveHeader_New(QDataStream& stream);
|
|
|
|
// 每次序列化版本更改后,要修改本时间
|
|
int getThisDate();
|
|
|
|
private:
|
|
|
|
// 涉及的一些内部变量,序列化相关信息
|
|
quint32 m_nXpfVer;
|
|
quint32 m_nDocVer;
|
|
quint32 m_nDocDate;
|
|
quint32 m_nDocFlags;
|
|
char m_sDocType[17];
|
|
int m_nQtStreamVer;
|
|
char m_chCompressFlag;
|
|
};
|
|
|
|
|
|
|
|
|