Panda3D
Loading...
Searching...
No Matches
virtualFileMountMultifile.h
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file virtualFileMountMultifile.h
10 * @author drose
11 * @date 2002-08-03
12 */
13
14#ifndef VIRTUALFILEMOUNTMULTIFILE_H
15#define VIRTUALFILEMOUNTMULTIFILE_H
16
17#include "pandabase.h"
18
19#include "virtualFileMount.h"
20#include "multifile.h"
21#include "pointerTo.h"
22
23/**
24 * Maps a Multifile's contents into the VirtualFileSystem.
25 */
26class EXPCL_PANDA_EXPRESS VirtualFileMountMultifile : public VirtualFileMount {
27PUBLISHED:
28 INLINE VirtualFileMountMultifile(Multifile *multifile);
30
31 INLINE Multifile *get_multifile() const;
32
33public:
34 virtual bool has_file(const Filename &file) const;
35 virtual bool is_directory(const Filename &file) const;
36 virtual bool is_regular_file(const Filename &file) const;
37
38 virtual bool read_file(const Filename &file, bool do_uncompress,
39 vector_uchar &result) const;
40
41 virtual std::istream *open_read_file(const Filename &file) const;
42 virtual std::streamsize get_file_size(const Filename &file, std::istream *stream) const;
43 virtual std::streamsize get_file_size(const Filename &file) const;
44 virtual time_t get_timestamp(const Filename &file) const;
45 virtual bool get_system_info(const Filename &file, SubfileInfo &info);
46
47 virtual bool scan_directory(vector_string &contents,
48 const Filename &dir) const;
49
50 virtual void output(std::ostream &out) const;
51
52private:
53 PT(Multifile) _multifile;
54
55
56public:
57 virtual TypeHandle get_type() const {
58 return get_class_type();
59 }
60 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
61 static TypeHandle get_class_type() {
62 return _type_handle;
63 }
64 static void init_type() {
65 VirtualFileMount::init_type();
66 register_type(_type_handle, "VirtualFileMountMultifile",
67 VirtualFileMount::get_class_type());
68 }
69
70private:
71 static TypeHandle _type_handle;
72};
73
75
76#endif
The name of a file, such as a texture file or an Egg file.
Definition filename.h:44
A file that contains a set of files.
Definition multifile.h:37
This class records a particular byte sub-range within an existing file on disk.
Definition subfileInfo.h:26
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
Maps a Multifile's contents into the VirtualFileSystem.
The abstract base class for a mount definition used within a VirtualFileSystem.
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 get_system_info(const Filename &file, SubfileInfo &info)
Populates the SubfileInfo structure with the data representing where the file actually resides on dis...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.