15 #include "virtualFileMountMultifile.h"
16 #include "virtualFileSystem.h"
18 TypeHandle VirtualFileMountMultifile::_type_handle;
26 VirtualFileMountMultifile::
27 ~VirtualFileMountMultifile() {
39 return (file.empty() ||
40 _multifile->find_subfile(file) >= 0 ||
41 _multifile->has_directory(file));
52 return (file.empty() || _multifile->has_directory(file));
63 return (_multifile->find_subfile(file) >= 0);
86 int subfile_index = _multifile->find_subfile(file);
87 if (subfile_index < 0) {
89 <<
"Unable to read " << file <<
"\n";
93 return _multifile->read_subfile(subfile_index, result);
106 int subfile_index = _multifile->find_subfile(file);
107 if (subfile_index < 0) {
115 return _multifile->open_read_subfile(subfile_index);
129 int subfile_index = _multifile->find_subfile(file);
130 if (subfile_index < 0) {
133 return _multifile->get_subfile_length(subfile_index);
144 int subfile_index = _multifile->find_subfile(file);
145 if (subfile_index < 0) {
148 return _multifile->get_subfile_length(subfile_index);
167 int subfile_index = _multifile->find_subfile(file);
168 if (subfile_index < 0) {
171 return _multifile->get_subfile_timestamp(subfile_index);
186 Filename multifile_name = _multifile->get_multifile_name();
187 if (multifile_name.empty()) {
190 int subfile_index = _multifile->find_subfile(file);
191 if (subfile_index < 0) {
194 if (_multifile->is_subfile_compressed(subfile_index) ||
195 _multifile->is_subfile_encrypted(subfile_index)) {
199 streampos start = _multifile->get_subfile_internal_start(subfile_index);
200 size_t length = _multifile->get_subfile_internal_length(subfile_index);
216 return _multifile->scan_directory(contents, dir);
225 void VirtualFileMountMultifile::
226 output(ostream &out)
const {
227 out << _multifile->get_multifile_name();
virtual streamsize get_file_size(const Filename &file, istream *stream) const
Returns the current size on disk (or wherever it is) of the already-open file.
virtual bool read_file(const Filename &file, bool do_uncompress, pvector< unsigned char > &result) const
Fills up the indicated pvector with the contents of the file, if it is a regular file.
The name of a file, such as a texture file or an Egg file.
virtual bool scan_directory(vector_string &contents, const Filename &dir) const
Fills the given vector up with the list of filenames that are local to this directory, if the filename is a directory.
virtual bool read_file(const Filename &file, bool do_uncompress, pvector< unsigned char > &result) const
Fills up the indicated pvector with the contents of the file, if it is a regular file.
virtual bool is_regular_file(const Filename &file) const
Returns true if the indicated file exists within the mount system and is a regular file...
virtual bool get_system_info(const Filename &file, SubfileInfo &info)
Populates the SubfileInfo structure with the data representing where the file actually resides on dis...
virtual bool is_directory(const Filename &file) const
Returns true if the indicated file exists within the mount system and is a directory.
virtual istream * open_read_file(const Filename &file) const
Opens the file for reading, if it exists.
This class records a particular byte sub-range within an existing file on disk.
virtual time_t get_timestamp(const Filename &file) const
Returns a time_t value that represents the time the file was last modified, to within whatever precis...
TypeHandle is the identifier used to differentiate C++ class types.
virtual bool has_file(const Filename &file) const
Returns true if the indicated file exists within the mount system.