17 TypeHandle VirtualFileMountMultifile::_type_handle;
23 VirtualFileMountMultifile::
24 ~VirtualFileMountMultifile() {
33 return (file.empty() ||
34 _multifile->find_subfile(file) >= 0 ||
35 _multifile->has_directory(file));
44 return (file.empty() || _multifile->has_directory(file));
53 return (_multifile->find_subfile(file) >= 0);
62 vector_uchar &result)
const {
73 int subfile_index = _multifile->find_subfile(file);
74 if (subfile_index < 0) {
76 <<
"Unable to read " << file <<
"\n";
80 return _multifile->read_subfile(subfile_index, result);
90 int subfile_index = _multifile->find_subfile(file);
91 if (subfile_index < 0) {
99 return _multifile->open_read_subfile(subfile_index);
109 int subfile_index = _multifile->find_subfile(file);
110 if (subfile_index < 0) {
113 return _multifile->get_subfile_length(subfile_index);
122 int subfile_index = _multifile->find_subfile(file);
123 if (subfile_index < 0) {
126 return _multifile->get_subfile_length(subfile_index);
141 int subfile_index = _multifile->find_subfile(file);
142 if (subfile_index < 0) {
145 return _multifile->get_subfile_timestamp(subfile_index);
157 Filename multifile_name = _multifile->get_multifile_name();
158 if (multifile_name.empty()) {
161 int subfile_index = _multifile->find_subfile(file);
162 if (subfile_index < 0) {
165 if (_multifile->is_subfile_compressed(subfile_index) ||
166 _multifile->is_subfile_encrypted(subfile_index)) {
170 std::streampos start = _multifile->get_subfile_internal_start(subfile_index);
171 size_t length = _multifile->get_subfile_internal_length(subfile_index);
184 return _multifile->scan_directory(contents, dir);
191 void VirtualFileMountMultifile::
192 output(std::ostream &out)
const {
193 out << _multifile->get_multifile_name();
virtual bool read_file(const Filename &file, bool do_uncompress, vector_uchar &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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool is_directory(const Filename &file) const
Returns true if the indicated file exists within the mount system and is a directory.
The name of a file, such as a texture file or an Egg file.
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...
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 std::istream * open_read_file(const Filename &file) const
Opens the file for reading, if it exists.
virtual std::streamsize get_file_size(const Filename &file, std::istream *stream) const
Returns the current size on disk (or wherever it is) of the already-open file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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,...
This class records a particular byte sub-range within an existing file on disk.
virtual bool has_file(const Filename &file) const
Returns true if the indicated file exists within the mount system.
TypeHandle is the identifier used to differentiate C++ class types.
virtual bool read_file(const Filename &file, bool do_uncompress, vector_uchar &result) const
Fills up the indicated pvector with the contents of the file, if it is a regular file.