Worldstone
 All Classes Files Functions Variables Enumerations Enumerator Macros Pages
WorldStone::Archive Class Referenceabstract

Base class to use/build archives. More...

#include <Archive.h>

Inheritance diagram for WorldStone::Archive:
WorldStone::IOBase WorldStone::MpqArchive

Public Member Functions

 Archive (const Archive &)=delete
 
Archiveoperator= (const Archive &)=delete
 
virtual bool exists (const Path &filePath)=0
 
virtual StreamPtr open (const Path &filePath)=0
 
virtual bool isThreadSafe ()
 
- Public Member Functions inherited from WorldStone::IOBase
 operator bool () const
 
bool operator! () const
 
bool good () const
 
bool eof () const
 
bool fail () const
 
bool bad () const
 

Protected Member Functions

virtual bool load ()=0
 
virtual bool is_loaded ()=0
 
virtual bool unload ()=0
 
- Protected Member Functions inherited from WorldStone::IOBase
void setstate (iostate state)
 

Additional Inherited Members

- Public Types inherited from WorldStone::IOBase
using Path = std::string
 
using iostate = int
 
- Protected Attributes inherited from WorldStone::IOBase
iostate _state = goodbit
 
- Static Protected Attributes inherited from WorldStone::IOBase
static constexpr iostate goodbit = 0x0
 
static constexpr iostate eofbit = 0x1
 
static constexpr iostate failbit = 0x2
 
static constexpr iostate badbit = 0x4
 

Detailed Description

Base class to use/build archives.

Archives are file/resource containers that provide basic I/O support. It can be implemented as a basic filesystem to read disks, compressed archives, databases. You can view this as an abstraction in the form of a directory

Note
Implementation does not need to be thread safe, so you have to handle race conditions yourself when manipulating multiple files from an archive, unless otherwise stated by the implementation You can however check if the implementation is thread-safe by calling isThreadSafe

Definition at line 24 of file Archive.h.


The documentation for this class was generated from the following files: