24 #ifndef BSA_BSA_FILE_H
25 #define BSA_BSA_FILE_H
83 typedef std::map<const char*, int, iltstr>
Lookup;
87 void fail(
const std::string &msg);
107 void open(
const std::string &file);
std::vector< char > stringBuf
Filename string buffer.
Definition: bsa_file.hpp:64
static bool ciLess(const std::string &x, const std::string &y)
Definition: stringops.hpp:58
void open(const std::string &file)
Open an archive file.
Definition: bsa_file.cpp:163
std::map< const char *, int, iltstr > Lookup
Definition: bsa_file.hpp:83
uint32_t fileSize
Definition: bsa_file.hpp:52
void readHeader()
Read header information from the input source.
Definition: bsa_file.cpp:42
uint32_t offset
Definition: bsa_file.hpp:52
Definition: bsa_file.hpp:43
const char * name
Definition: bsa_file.hpp:55
std::string filename
Used for error messages.
Definition: bsa_file.hpp:70
void fail(const std::string &msg)
Error handling.
Definition: bsa_file.cpp:36
bool exists(const char *file) const
Check if a file exists.
Definition: bsa_file.hpp:115
BSAFile()
Definition: bsa_file.hpp:102
bool isLoaded
True when an archive has been loaded.
Definition: bsa_file.hpp:67
boost::shared_ptr< std::istream > IStreamPtr
Definition: constrainedfilestream.hpp:20
int getIndex(const char *str) const
Get the index of a given file name, or -1 if not found.
Definition: bsa_file.cpp:151
std::vector< FileStruct > FileList
Definition: bsa_file.hpp:57
bool operator()(const char *s1, const char *s2) const
Definition: bsa_file.hpp:75
Files::IStreamPtr getFile(const char *file)
Definition: bsa_file.cpp:169
Case insensitive string comparison.
Definition: bsa_file.hpp:73
Lookup lookup
Definition: bsa_file.hpp:84
FileList files
Table of files in this archive.
Definition: bsa_file.hpp:61
Represents one file entry in the archive.
Definition: bsa_file.hpp:47
const FileList & getList() const
Definition: bsa_file.hpp:131