Panda3D
pandaIOSystem.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 pandaIOSystem.h
10  * @author rdb
11  * @date 2011-03-29
12  */
13 
14 #ifndef PANDAIOSYSTEM_H
15 #define PANDAIOSYSTEM_H
16 
17 #include "config_assimp.h"
18 #include "virtualFileSystem.h"
19 
20 #include <assimp/IOSystem.hpp>
21 
22 /**
23  * Custom implementation of Assimp::IOSystem.
24  */
25 class PandaIOSystem : public Assimp::IOSystem {
26 public:
28  virtual ~PandaIOSystem() {};
29 
30  void Close(Assimp::IOStream *file);
31  bool ComparePaths(const char *p1, const char *p2) const;
32  bool Exists(const char *file) const;
33  char getOsSeparator() const;
34  Assimp::IOStream *Open(const char *file, const char *mode);
35 
36 private:
37  VirtualFileSystem *_vfs;
38 };
39 
40 #endif
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,...
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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:25