*
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#include "IZipFile.h"
|
||||
#include "IZipFileContentProvider.h"
|
||||
|
||||
namespace LifeCore
|
||||
{
|
||||
IZipFile::IZipFile()
|
||||
{
|
||||
isOpen = false;
|
||||
}
|
||||
IDataStreamPtr IZipFile::OpenWrite(int mode)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(mode);
|
||||
g_stream = new IZipStream(((IZipFileContentProvider*)this->Provider)->g_sourceFile, EntryName, FA_WRITE, ((IZipFileContentProvider*)this->Provider)->g_rootFolder);
|
||||
return IDataStreamPtr(g_stream);
|
||||
}
|
||||
IDataStreamPtr IZipFile::OpenReadWrite(int mode)
|
||||
{
|
||||
UNREFERENCED_PARAMETER(mode);
|
||||
throw;
|
||||
//return IDataStreamPtr(0);
|
||||
//throw new NotImplementedException();
|
||||
}
|
||||
|
||||
IDataStreamPtr IZipFile::OpenRead()
|
||||
{
|
||||
IZipFileContentProvider* prov = (IZipFileContentProvider*)this->Provider;
|
||||
prov->g_sourceFile = unzOpen(prov->g_rootFolder.c_str());
|
||||
g_stream = new IZipStream(prov->g_sourceFile, EntryName, FA_READ, NULL);
|
||||
return IDataStreamPtr(g_stream);
|
||||
//g_stream = new IZipStream((this->Provider as IZipFileContentProvider).GetSource(), EntryName, FA_READ);
|
||||
//return g_stream;
|
||||
}
|
||||
void IZipFile::Close()
|
||||
{
|
||||
if(g_stream)
|
||||
{
|
||||
g_stream->Close();
|
||||
delete g_stream;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user