PixelLightAPI
.
|
This class represents a handle for working on a ZIP-file. More...
#include <ZipHandle.h>
Classes | |
class | ZipEntry |
Represents an entry (file or directory) in a ZIP-file. More... | |
Public Member Functions | |
PLCORE_API | ZipHandle () |
Constructor. | |
PLCORE_API | ~ZipHandle () |
Destructor. | |
PLCORE_API bool | IsOpen () const |
Check if the ZIP-file is open. | |
PLCORE_API bool | Open (const String &sFilename, const String &sPassword, bool bCaseSensitive=true, bool bMemBuf=true, const FileAccess *pAccess=nullptr) |
Open the ZIP-file. | |
PLCORE_API bool | Close () |
Close the ZIP file. | |
PLCORE_API bool | IsCaseSensitive () const |
Returns whether names treated case sensitive. | |
PLCORE_API bool | LocateFirstFile () |
Sets the pointer to the first entry in the ZIP-file. | |
PLCORE_API bool | LocateNextFile () |
Sets the pointer to the next entry in the ZIP-file. | |
PLCORE_API bool | LocateFile (const String &sFilename) |
Sets the pointer to a specific entry in the ZIP-file. | |
PLCORE_API const ZipEntry & | GetCurrentFile () const |
Get information about the current entry in the ZIP-file. | |
PLCORE_API bool | IsFileOpen () const |
Check if a file is currently open. | |
PLCORE_API bool | OpenFile () |
Open the currently selected file. | |
PLCORE_API bool | CloseFile () |
Close file. | |
PLCORE_API uint32 | Read (void *pBuffer, uint32 nSize, uint32 nCount) |
Reads data from the file. | |
PLCORE_API bool | Seek (int32 nOffset, File::ESeek nLocation) |
Sets the starting position. | |
PLCORE_API int32 | Tell () const |
Returns the file position. | |
PLCORE_API bool | IsEof () const |
Returns whether end of file has been reached. | |
PLCORE_API uint32 | GetLocalExtrafieldSize () const |
Gets the size of the current file's extra data field. | |
PLCORE_API bool | GetLocalExtrafield (void *pBuffer, uint32 nSize) |
Reads the extra data of the current file. |
This class represents a handle for working on a ZIP-file.
PLCORE_API PLCore::ZipHandle::ZipHandle | ( | ) |
PLCORE_API PLCore::ZipHandle::~ZipHandle | ( | ) |
Destructor.
PLCORE_API bool PLCore::ZipHandle::IsOpen | ( | ) | const |
Check if the ZIP-file is open.
PLCORE_API bool PLCore::ZipHandle::Open | ( | const String & | sFilename, |
const String & | sPassword, | ||
bool | bCaseSensitive = true , |
||
bool | bMemBuf = true , |
||
const FileAccess * | pAccess = nullptr |
||
) |
Open the ZIP-file.
[in] | sFilename | Filename of the ZIP-file |
[in] | sPassword | Password if the file is encrypted, else empty string |
[in] | bCaseSensitive | Shall the filenames be treated case sensitive? |
[in] | bMemBuf | Shall the ZIP-file be read into a memory-buffer? |
[in] | pAccess | Access information to pass through (can be a null pointer) |
PLCORE_API bool PLCore::ZipHandle::Close | ( | ) |
Close the ZIP file.
PLCORE_API bool PLCore::ZipHandle::IsCaseSensitive | ( | ) | const |
Returns whether names treated case sensitive.
PLCORE_API bool PLCore::ZipHandle::LocateFirstFile | ( | ) |
Sets the pointer to the first entry in the ZIP-file.
PLCORE_API bool PLCore::ZipHandle::LocateNextFile | ( | ) |
Sets the pointer to the next entry in the ZIP-file.
PLCORE_API bool PLCore::ZipHandle::LocateFile | ( | const String & | sFilename | ) |
Sets the pointer to a specific entry in the ZIP-file.
[in] | sFilename | Name of the file |
PLCORE_API const ZipEntry& PLCore::ZipHandle::GetCurrentFile | ( | ) | const |
Get information about the current entry in the ZIP-file.
PLCORE_API bool PLCore::ZipHandle::IsFileOpen | ( | ) | const |
Check if a file is currently open.
PLCORE_API bool PLCore::ZipHandle::OpenFile | ( | ) |
Open the currently selected file.
PLCORE_API bool PLCore::ZipHandle::CloseFile | ( | ) |
Close file.
PLCORE_API uint32 PLCore::ZipHandle::Read | ( | void * | pBuffer, |
uint32 | nSize, | ||
uint32 | nCount | ||
) |
Reads data from the file.
[out] | pBuffer | Buffer to store the data (MUST be valid and large enough!) |
[in] | nSize | Item size in bytes |
[in] | nCount | Number of items to read |
PLCORE_API bool PLCore::ZipHandle::Seek | ( | int32 | nOffset, |
File::ESeek | nLocation | ||
) |
Sets the starting position.
[in] | nOffset | File offset in bytes relative to the given location |
[in] | nLocation | Location |
PLCORE_API int32 PLCore::ZipHandle::Tell | ( | ) | const |
Returns the file position.
PLCORE_API bool PLCore::ZipHandle::IsEof | ( | ) | const |
Returns whether end of file has been reached.
PLCORE_API uint32 PLCore::ZipHandle::GetLocalExtrafieldSize | ( | ) | const |
Gets the size of the current file's extra data field.
PLCORE_API bool PLCore::ZipHandle::GetLocalExtrafield | ( | void * | pBuffer, |
uint32 | nSize | ||
) |
Reads the extra data of the current file.
[out] | pBuffer | Buffer to store the data (MUST valid and large enough!) |
[in] | nSize | Size of the buffer (MUST be valid!) |
|