Panda3D
pandaIOSystem.h
1 // Filename: pandaIOSystem.h
2 // Created by: rdb (29Mar11)
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 PANDAIOSYSTEM_H
16 #define PANDAIOSYSTEM_H
17 
18 #include "config_assimp.h"
19 #include "virtualFileSystem.h"
20 
21 #include "IOSystem.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Class : PandaIOSystem
25 // Description : Custom implementation of Assimp::IOSystem.
26 ////////////////////////////////////////////////////////////////////
27 class PandaIOSystem : public Assimp::IOSystem {
28 public:
30  virtual ~PandaIOSystem() {};
31 
32  void Close(Assimp::IOStream *file);
33  bool ComparePaths(const char *p1, const char *p2) const;
34  bool Exists(const char *file) const;
35  char getOsSeparator() const;
36  Assimp::IOStream *Open(const char *file, const char *mode);
37 
38 private:
39  VirtualFileSystem *_vfs;
40 };
41 
42 #endif
43 
Assimp::IOStream * Open(const char *file, const char *mode)
Opens the indicated file.
char getOsSeparator() const
Returns the path separator for this operating system.
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's file system.
void Close(Assimp::IOStream *file)
Closes the indicated file stream.
bool ComparePaths(const char *p1, const char *p2) const
Returns true if the two paths point to the same file, false if not.
static VirtualFileSystem * get_global_ptr()
Returns the default global VirtualFileSystem.
bool Exists(const char *file) const
Returns true if the file exists, duh.
PandaIOSystem(VirtualFileSystem *vfs=VirtualFileSystem::get_global_ptr())
Initializes the object with the given VFS, or the global one if none was specified.
Custom implementation of Assimp::IOSystem.
Definition: pandaIOSystem.h:27