界面效果如下:

MFC 自定义压缩,解压缩工具_解压缩

MFC 自定义压缩,解压缩工具_解压缩_02

对外提供的接口如下:

public:
    void setCallback(zp::Callback callback, void* param);
    bool open(const zp::String& path, bool readonly = false);
     bool create(const zp::String& path, const zp::String& inputPath);
     void close();
     bool isOpen() const;    bool defrag();
    zp::IPackage* getPack() const;
    const zp::Char* packageFilename() const;
    bool enterDir(const zp::String& path);
    //srcPath can't be empty
     //if dstPath is empty, file/dir will be add to current path of package
     bool add(const zp::String& srcPath, const zp::String& dstPath, bool flush = true);    bool remove(const zp::String& path);
     
     void flush();    //if srcPath is empty, current path of package will be extracted
     //if dstPath is empty, file/dir will be extracted to current path of system
     bool extract(const zp::String& srcPath, const zp::String& dstPath);    void setCurrentNode(const ZpNode* node);
     const ZpNode* currentNode() const;
     const ZpNode* rootNode() const;    const zp::String& currentPath() const;
     void getNodePath(const ZpNode* node, zp::String& path) const;    zp::u64 countDiskFileSize(const zp::String& path);
     zp::u64 countNodeFileSize(const ZpNode* node);