Panda3D
 All Classes Functions Variables Enumerations
virtualFileComposite.h
1 // Filename: virtualFileComposite.h
2 // Created by: drose (03Aug02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef VIRTUALFILECOMPOSITE_H
16 #define VIRTUALFILECOMPOSITE_H
17 
18 #include "pandabase.h"
19 
20 #include "virtualFile.h"
21 
22 ////////////////////////////////////////////////////////////////////
23 // Class : VirtualFileComposite
24 // Description : A composite directory within the VirtualFileSystem:
25 // this maps to more than one directory on different
26 // mount points. The resulting directory appears to be
27 // the union of all the individual simple directories.
28 ////////////////////////////////////////////////////////////////////
29 class EXPCL_PANDAEXPRESS VirtualFileComposite : public VirtualFile {
30 public:
31  INLINE VirtualFileComposite(VirtualFileSystem *file_system,
32  const Filename &filename);
33 
34  INLINE void add_component(VirtualFile *file);
35 
36  virtual VirtualFileSystem *get_file_system() const;
37  virtual Filename get_filename() const;
38 
39  virtual bool has_file() const;
40  virtual bool is_directory() const;
41 
42 protected:
43  virtual bool scan_local_directory(VirtualFileList *file_list,
44  const ov_set<string> &mount_points) const;
45 
46 private:
47  VirtualFileSystem *_file_system;
48  Filename _filename;
50  Components _components;
51 
52 public:
53  virtual TypeHandle get_type() const {
54  return get_class_type();
55  }
56  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
57 
58 PUBLISHED:
59  static TypeHandle get_class_type() {
60  return _type_handle;
61  }
62 
63 public:
64  static void init_type() {
65  VirtualFile::init_type();
66  register_type(_type_handle, "VirtualFileComposite",
67  VirtualFile::get_class_type());
68  }
69 
70 private:
71  static TypeHandle _type_handle;
72 };
73 
74 #include "virtualFileComposite.I"
75 
76 #endif
A hierarchy of directories and files that appears to be one continuous file system, even though the files may originate from several different sources that may not be related to the actual OS&#39;s file system.
The abstract base class for a file or directory within the VirtualFileSystem.
Definition: virtualFile.h:37
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:39
virtual bool has_file() const
Returns true if this file exists, false otherwise.
Definition: virtualFile.cxx:30
A list of VirtualFiles, as returned by VirtualFile::scan_directory().
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:85
A composite directory within the VirtualFileSystem: this maps to more than one directory on different...
virtual bool is_directory() const
Returns true if this file represents a directory (and scan_directory() may be called), false otherwise.
Definition: virtualFile.cxx:41