/src/ogre/OgreMain/include/OgreFileSystem.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | ----------------------------------------------------------------------------- |
3 | | This source file is part of OGRE |
4 | | (Object-oriented Graphics Rendering Engine) |
5 | | For the latest info, see http://www.ogre3d.org/ |
6 | | |
7 | | Copyright (c) 2000-2014 Torus Knot Software Ltd |
8 | | |
9 | | Permission is hereby granted, free of charge, to any person obtaining a copy |
10 | | of this software and associated documentation files (the "Software"), to deal |
11 | | in the Software without restriction, including without limitation the rights |
12 | | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
13 | | copies of the Software, and to permit persons to whom the Software is |
14 | | furnished to do so, subject to the following conditions: |
15 | | |
16 | | The above copyright notice and this permission notice shall be included in |
17 | | all copies or substantial portions of the Software. |
18 | | |
19 | | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
20 | | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
21 | | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
22 | | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
23 | | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
24 | | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
25 | | THE SOFTWARE. |
26 | | ----------------------------------------------------------------------------- |
27 | | */ |
28 | | #ifndef __FileSystem_H__ |
29 | | #define __FileSystem_H__ |
30 | | |
31 | | #include "OgrePrerequisites.h" |
32 | | |
33 | | #include "OgreArchive.h" |
34 | | #include "OgreArchiveFactory.h" |
35 | | #include "OgreHeaderPrefix.h" |
36 | | |
37 | | struct AAssetManager; |
38 | | |
39 | | namespace Ogre { |
40 | | |
41 | | /** \addtogroup Core |
42 | | * @{ |
43 | | */ |
44 | | /** \addtogroup Resources |
45 | | * @{ |
46 | | */ |
47 | | |
48 | | /// internal method to open a FileStreamDataStream |
49 | | DataStreamPtr _openFileStream(const String& path, std::ios::openmode mode, const String& name = ""); |
50 | | |
51 | | /** Specialisation of the ArchiveFactory to allow reading of files from |
52 | | filesystem folders / directories. |
53 | | */ |
54 | | class _OgreExport FileSystemArchiveFactory : public ArchiveFactory |
55 | | { |
56 | | public: |
57 | | /// @copydoc FactoryObj::getType |
58 | | const String& getType(void) const override; |
59 | | |
60 | | //! @cond Doxygen_Suppress |
61 | | using ArchiveFactory::createInstance; |
62 | | //! @endcond |
63 | | |
64 | | Archive *createInstance( const String& name, bool readOnly ) override; |
65 | | |
66 | | /// Set whether filesystem enumeration will include hidden files or not. |
67 | | /// This should be called prior to declaring and/or initializing filesystem |
68 | | /// resource locations. The default is true (ignore hidden files). |
69 | | static void setIgnoreHidden(bool ignore); |
70 | | |
71 | | /// Get whether hidden files are ignored during filesystem enumeration. |
72 | | static bool getIgnoreHidden(); |
73 | | }; |
74 | | |
75 | | class APKFileSystemArchiveFactory : public ArchiveFactory |
76 | | { |
77 | | public: |
78 | 0 | APKFileSystemArchiveFactory(AAssetManager* assetMgr) : mAssetMgr(assetMgr) {} |
79 | 0 | virtual ~APKFileSystemArchiveFactory() {} |
80 | | /// @copydoc FactoryObj::getType |
81 | | const String& getType(void) const override; |
82 | | /// @copydoc ArchiveFactory::createInstance |
83 | | Archive *createInstance( const String& name, bool readOnly ) override; |
84 | | private: |
85 | | AAssetManager* mAssetMgr; |
86 | | }; |
87 | | |
88 | | /** @} */ |
89 | | /** @} */ |
90 | | |
91 | | } // namespace Ogre |
92 | | |
93 | | #include "OgreHeaderSuffix.h" |
94 | | |
95 | | #endif // __FileSystem_H__ |