Nebula
Loading...
Searching...
No Matches
zipfilestream.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
32#include "io/stream.h"
33
34//------------------------------------------------------------------------------
35namespace IO
36{
37class ZipFileEntry;
38class ZipFileStream : public Stream
39{
41public:
45 virtual ~ZipFileStream();
47 virtual bool CanRead() const;
49 virtual bool CanWrite() const;
51 virtual bool CanSeek() const;
53 virtual bool CanBeMapped() const;
55 virtual Size GetSize() const;
57 virtual Position GetPosition() const;
59 virtual bool Open();
61 virtual void Close();
63 virtual Size Read(void* ptr, Size numBytes);
65 virtual void Seek(Offset offset, SeekOrigin origin);
67 virtual bool Eof() const;
69 virtual void* Map();
71 virtual void Unmap();
73 virtual void* MemoryMap();
75 virtual void MemoryUnmap();
76
77private:
79 bool CopyToMap();
83 unsigned char *mapBuffer;
84};
85
86} // namespace IO
87//------------------------------------------------------------------------------
Offers an abstract interface for read/write access to a sequence of bytes.
Definition stream.h:28
SeekOrigin
seek origins
Definition stream.h:54
int64_t Offset
Definition stream.h:33
int64_t Position
typedefs
Definition stream.h:32
int64_t Size
Definition stream.h:34
A file entry in a zip archive.
Definition zipfileentry.h:22
Wraps a file in a zip archive into a stream.
Definition zipfilestream.h:39
virtual void Unmap()
unmap a mapped stream
Definition zipfilestream.cc:246
virtual void * Map()
map for direct memory-access
Definition zipfilestream.cc:233
ZipFileEntry * zipFileEntry
Definition zipfilestream.h:82
__DeclareClass(ZipFileStream)
virtual Size Read(void *ptr, Size numBytes)
directly read from the stream
Definition zipfilestream.cc:170
virtual Position GetPosition() const
get the current position of the read/write cursor
Definition zipfilestream.cc:91
virtual void Seek(Offset offset, SeekOrigin origin)
seek in stream, only forward seeks are allowed
Definition zipfilestream.cc:192
virtual bool Eof() const
return true if end-of-stream reached
Definition zipfilestream.cc:221
Size size
Definition zipfilestream.h:80
unsigned char * mapBuffer
Definition zipfilestream.h:83
virtual bool CanWrite() const
memory streams support writing
Definition zipfilestream.cc:55
virtual void Close()
close the stream
Definition zipfilestream.cc:152
virtual ~ZipFileStream()
destructor
Definition zipfilestream.cc:33
ZipFileStream()
constructor
Definition zipfilestream.cc:22
Position position
Definition zipfilestream.h:81
bool CopyToMap()
uncompress all to mapBuffer
Definition zipfilestream.cc:274
virtual bool CanRead() const
memory streams support reading
Definition zipfilestream.cc:46
virtual bool Open()
open the stream
Definition zipfilestream.cc:102
virtual Size GetSize() const
get the size of the stream in bytes
Definition zipfilestream.cc:82
virtual void MemoryUnmap()
unmap memory stream
Definition zipfilestream.cc:265
virtual bool CanSeek() const
memory streams support seeking
Definition zipfilestream.cc:64
virtual bool CanBeMapped() const
memory streams are mappable
Definition zipfilestream.cc:73
virtual void * MemoryMap()
map for direct memory-access, does nothing but call Map()
Definition zipfilestream.cc:256
Instances of wrapped stream classes.
Definition orientation.cc:10