SO3Engine
SO3ScolUrl.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of OpenSpace3D
4 For the latest info, see http://www.openspace3d.com
5 
6 Copyright (c) 2012 I-maginer
7 
8 This program is free software; you can redistribute it and/or modify it under
9 the terms of the GNU Lesser General Public License as published by the Free Software
10 Foundation; either version 2 of the License, or (at your option) any later
11 version.
12 
13 This program is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16 
17 You should have received a copy of the GNU Lesser General Public License along with
18 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20 http://www.gnu.org/copyleft/lesser.txt
21 
22 -----------------------------------------------------------------------------
23 */
24 
30 #ifndef __SO3_SCOL_URL_H__
31 #define __SO3_SCOL_URL_H__
32 
34 
35 namespace SO3
36 {
37 
41 class SO3ScolUrlArchive : public Ogre::Archive
42 {
43 public:
47  SO3ScolUrlArchive(const Ogre::String& name, const Ogre::String& archType);
48 
53 
57  virtual bool isCaseSensitive() const;
58 
62  virtual void load();
63 
67  virtual void unload();
68 
72  virtual Ogre::DataStreamPtr open(const Ogre::String& filename, bool readOnly = true) const;
73 
77  virtual Ogre::StringVectorPtr list(bool recursive = true, bool dirs = false) const;
78 
82  virtual Ogre::FileInfoListPtr listFileInfo(bool recursive = true, bool dirs = false) const;
83 
87  virtual Ogre::StringVectorPtr find(const Ogre::String& pattern, bool recursive = true, bool dirs = false) const;
88 
92  virtual Ogre::FileInfoListPtr findFileInfo(const Ogre::String& pattern, bool recursive = true, bool dirs = false) const;
93 
94 
98  virtual bool exists(const Ogre::String& filename) const;
99 
103  virtual time_t getModifiedTime(const Ogre::String& filename) const;
104 };
105 
109 class SO3ScolUrlArchiveFactory : public Ogre::ArchiveFactory
110 {
111 public:
116  {
117  }
118 
122  const Ogre::String& getType() const
123  {
124  static Ogre::String name = "ScolURL";
125  return name;
126  }
127 
131  virtual Ogre::Archive *createInstance(const Ogre::String& name, bool readOnly)
132  {
133  return OGRE_NEW SO3ScolUrlArchive(name, "ScolURL");
134  }
135 
139  void destroyInstance(Ogre::Archive* arch)
140  {
141  delete arch;
142  }
143 };
144 
145 }
146 
147 #endif
SO3ScolUrlArchive(const Ogre::String &name, const Ogre::String &archType)
Definition: SO3ScolUrl.cpp:54
virtual time_t getModifiedTime(const Ogre::String &filename) const
virtual bool isCaseSensitive() const
Definition: SO3ScolUrl.cpp:59
librairies include
virtual bool exists(const Ogre::String &filename) const
virtual Ogre::DataStreamPtr open(const Ogre::String &filename, bool readOnly=true) const
virtual void unload()
Definition: SO3ScolUrl.cpp:77
virtual Ogre::FileInfoListPtr listFileInfo(bool recursive=true, bool dirs=false) const
void destroyInstance(Ogre::Archive *arch)
Definition: SO3ScolUrl.h:139
virtual Ogre::StringVectorPtr find(const Ogre::String &pattern, bool recursive=true, bool dirs=false) const
virtual Ogre::FileInfoListPtr findFileInfo(const Ogre::String &pattern, bool recursive=true, bool dirs=false) const
virtual Ogre::Archive * createInstance(const Ogre::String &name, bool readOnly)
Definition: SO3ScolUrl.h:131
virtual Ogre::StringVectorPtr list(bool recursive=true, bool dirs=false) const
const Ogre::String & getType() const
Definition: SO3ScolUrl.h:122
virtual void load()
Definition: SO3ScolUrl.cpp:71