Game Development Reference
In-Depth Information
{ return (const ubyte*) FBuffer; }
virtual uint64 GetFileSize() const
{ return FBufferSize; }
void CreateFromString( const std::string& InString );
void CreateFromBuffer( const void* Buf, uint64 Size );
void CreateFromManagedBuffer( const void* Buf, uint64 Size );
private:
bool FOwnsBuffer;
const void* FBuffer;
uint64 FBufferSize;
};
How it works...
We use the MemRawFile as an adapter for the memory block extracted from a .zip ile and
ManagedMemRawFile as the container for data downloaded from photo sites.
See also
F Chapter 3 , Networking
F Chapter 6 , Unifying OpenGL ES 3 and OpenGL3
Implementing mount points
It is convenient to access all of the application's resources as if they all were in the same
folder tree, no matter where they actually come from—from an actual ile, a .zip archive on
disk, or an in-memory archive downloaded over a network. Let us implement an abstraction
layer for this kind of access.
Getting ready
We assume that the reader is familiar with the concepts of NTFS reparse points ( http://
en.wikipedia.org/wiki/NTFS_reparse_point ), UNIX symbolic links ( http://
en.wikipedia.org/wiki/Symbolic_link ), and directory mounting procedures
( http://en.wikipedia.org/wiki/Mount_(Unix) ).
How to do it...
1.
Our folders tree will consist of abstract mount points. A single mount point can
correspond to a path to an existing OS folder, a .zip archive on disk, a path inside
a .zip archive, or it can even represent a removed network path.
 
Search WWH ::




Custom Search