Panda3D
Loading...
Searching...
No Matches
virtualFileComposite.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 virtualFileComposite.h
10 * @author drose
11 * @date 2002-08-03
12 */
13
14#ifndef VIRTUALFILECOMPOSITE_H
15#define VIRTUALFILECOMPOSITE_H
16
17#include "pandabase.h"
18
19#include "virtualFile.h"
20
21/**
22 * A composite directory within the VirtualFileSystem: this maps to more than
23 * one directory on different mount points. The resulting directory appears
24 * to be the union of all the individual simple directories.
25 */
26class EXPCL_PANDA_EXPRESS VirtualFileComposite : public VirtualFile {
27public:
28 INLINE VirtualFileComposite(VirtualFileSystem *file_system,
29 const Filename &filename);
30
31 INLINE void add_component(VirtualFile *file);
32
33 virtual VirtualFileSystem *get_file_system() const;
34 virtual Filename get_filename() const;
35
36 virtual bool has_file() const;
37 virtual bool is_directory() const;
38
39protected:
40 virtual bool scan_local_directory(VirtualFileList *file_list,
41 const ov_set<std::string> &mount_points) const;
42
43private:
44 VirtualFileSystem *_file_system;
45 Filename _filename;
46 typedef pvector< PT(VirtualFile) > Components;
47 Components _components;
48
49public:
50 virtual TypeHandle get_type() const {
51 return get_class_type();
52 }
53 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
54
55PUBLISHED:
56 static TypeHandle get_class_type() {
57 return _type_handle;
58 }
59
60public:
61 static void init_type() {
62 VirtualFile::init_type();
63 register_type(_type_handle, "VirtualFileComposite",
64 VirtualFile::get_class_type());
65 }
66
67private:
68 static TypeHandle _type_handle;
69};
70
72
73#endif
The name of a file, such as a texture file or an Egg file.
Definition filename.h:44
TypeHandle is the identifier used to differentiate C++ class types.
Definition typeHandle.h:81
A composite directory within the VirtualFileSystem: this maps to more than one directory on different...
A list of VirtualFiles, as returned by VirtualFile::scan_directory().
A hierarchy of directories and files that appears to be one continuous file system,...
The abstract base class for a file or directory within the VirtualFileSystem.
Definition virtualFile.h:35
virtual bool has_file() const
Returns true if this file exists, false otherwise.
virtual bool is_directory() const
Returns true if this file represents a directory (and scan_directory() may be called),...
A specialization of ordered_vector that emulates a standard STL set: one copy of each element is allo...
This is our own Panda specialization on the default STL vector.
Definition pvector.h:42
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.