Crazy Eddie's GUI System  0.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
MinizipResourceProvider.h
1 /***********************************************************************
2  filename: CEGUIMinizipResourceProvider.h
3  created: 19/3/2010
4  author: Jeff A. Marr
5 
6  purpose: Defines a resource provider for minizip archives
7 *************************************************************************/
8 /***************************************************************************
9  * Copyright (C) 2004 - 2010 Paul D Turner & The CEGUI Development Team
10  *
11  * Permission is hereby granted, free of charge, to any person obtaining
12  * a copy of this software and associated documentation files (the
13  * "Software"), to deal in the Software without restriction, including
14  * without limitation the rights to use, copy, modify, merge, publish,
15  * distribute, sublicense, and/or sell copies of the Software, and to
16  * permit persons to whom the Software is furnished to do so, subject to
17  * the following conditions:
18  *
19  * The above copyright notice and this permission notice shall be
20  * included in all copies or substantial portions of the Software.
21  *
22  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
25  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
26  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
27  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  * OTHER DEALINGS IN THE SOFTWARE.
29  ***************************************************************************/
30 #ifndef _CEGUIMinizipResourceProvider_h_
31 #define _CEGUIMinizipResourceProvider_h_
32 
33 #include "CEGUI/Base.h"
34 #include "CEGUI/DefaultResourceProvider.h"
35 
36 #if defined(_MSC_VER)
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
39 #endif
40 
41 // NOTE: While the DefaultResourceProvider (DRP) was not originally intended
42 // to be derived from, the purpose of this class is to extend the behavior of
43 // the default implementation. The only difference is that this class will
44 // attempt to load resources from a zip archive if the resource does not exist
45 // outside the archive.
46 
47 // Start of CEGUI namespace section
48 namespace CEGUI
49 {
51 {
52 public:
53  /*************************************************************************
54  Construction and Destruction
55  *************************************************************************/
57  MinizipResourceProvider(const String& archive, bool loadLocal = true);
59 
67  void setArchive(const String& archive);
68  void setLoadLocal(bool load = true);
69 
70  void loadRawDataContainer(const String& filename,
71  RawDataContainer& output,
72  const String& resourceGroup);
73  size_t getResourceGroupFileNames(std::vector<String>& out_vec,
74  const String& file_pattern,
75  const String& resource_group);
76 protected:
77  bool doesFileExist(const String& filename);
78  void openArchive();
79  void closeArchive();
80 
81  struct Impl;
82  Impl* d_pimpl;
83 };
84 
85 } // End of CEGUI namespace section
86 
87 #if defined(_MSC_VER)
88 # pragma warning(pop)
89 #endif
90 
91 #endif // end of guard _CEGUIMinizipResourceProvider_h_
92