设计模式例程
This commit is contained in:
37
inc/facade.hpp
Normal file
37
inc/facade.hpp
Normal file
@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
#include "common.hpp"
|
||||
|
||||
class ZIPModel
|
||||
{
|
||||
public:
|
||||
void compress(string srcFilePath, string dstFilePath);
|
||||
void decompress(string srcFilePath, string dstFilePath);
|
||||
};
|
||||
|
||||
class RARModel
|
||||
{
|
||||
public:
|
||||
void compress(string srcFilePath, string dstFilePath);
|
||||
void decompress(string srcFilePath, string dstFilePath);
|
||||
};
|
||||
|
||||
class ZModel
|
||||
{
|
||||
public:
|
||||
void compress(string srcFilePath, string dstFilePath);
|
||||
void decompress(string srcFilePath, string dstFilePath);
|
||||
};
|
||||
|
||||
class CompressionFacade
|
||||
{
|
||||
public:
|
||||
CompressionFacade(ZIPModel* pZipModel = nullptr, RARModel* pRarModel = nullptr, ZModel* pZModel = nullptr);
|
||||
~CompressionFacade();
|
||||
void compress(string srcFilePath, string dstFilePath, string type);
|
||||
void decompress(string srcFilePath, string dstFilePath);
|
||||
|
||||
private:
|
||||
ZIPModel* m_pZipModel;
|
||||
RARModel* m_pRarModel;
|
||||
ZModel* m_pZModel;
|
||||
};
|
Reference in New Issue
Block a user