Nebula
Loading...
Searching...
No Matches
zipfileentry.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
14#include "io/stream.h"
15#include "minizip/unzip.h"
16#include "util/stringatom.h"
17
18//------------------------------------------------------------------------------
19namespace IO
20{
22{
23public:
28
30 const Util::StringAtom& GetName() const;
33
35 bool Open(const Util::String& password = "");
37 void Close();
39 bool Read(void* buf, IO::Stream::Size bufSize) const;
40
41private:
42 friend class ZipArchive;
43
46
49 unzFile zipFileHandle; // handle on zip file
50 unz64_file_pos filePosInfo; // info about position in zip file
51 uint64_t uncompressedSize; // uncompressed size of the file
52};
53
54//------------------------------------------------------------------------------
57inline const Util::StringAtom&
59{
60 return this->name;
61}
62
63//------------------------------------------------------------------------------
68{
69 return this->uncompressedSize;
70}
71
72} // namespace IO
73//------------------------------------------------------------------------------
74
int64_t Size
Definition stream.h:34
Private helper class for ZipFileSystem to hold per-Zip-archive data.
Definition ziparchive.h:26
A file entry in a zip archive.
Definition zipfileentry.h:22
Util::StringAtom name
Definition zipfileentry.h:48
const Util::StringAtom & GetName() const
get name of the file entry
Definition zipfileentry.h:58
bool Open(const Util::String &password="")
open the zip file
Definition zipfileentry.cc:64
bool Read(void *buf, IO::Stream::Size bufSize) const
read the entire content into the provided memory buffer
Definition zipfileentry.cc:114
ZipFileEntry()
constructor
Definition zipfileentry.cc:17
IO::Stream::Size GetFileSize() const
get the uncompressed file size in bytes
Definition zipfileentry.h:67
void Close()
close the zip file
Definition zipfileentry.cc:100
unz64_file_pos filePosInfo
Definition zipfileentry.h:50
uint64_t uncompressedSize
Definition zipfileentry.h:51
~ZipFileEntry()
destructor
Definition zipfileentry.cc:28
unzFile zipFileHandle
Definition zipfileentry.h:49
Threading::CriticalSection * archiveCritSect
Definition zipfileentry.h:47
void Setup(const Util::StringAtom &name, unzFile zipFileHandle, Threading::CriticalSection *critSect)
setup the file entry object
Definition zipfileentry.cc:37
Critical section objects are used to protect a portion of code from parallel execution.
A StringAtom.
Definition stringatom.h:22
Instances of wrapped stream classes.
Definition orientation.cc:10
Nebula's universal string class.
Definition string.h:50