Crazy Eddie's GUI System  0.8.7
ResourceProvider.h
1 /***********************************************************************
2  created: 8/7/2004
3  author: James '_mental_' O'Sullivan
4 
5  purpose: Defines abstract base class for loading DataContainer objects
6 *************************************************************************/
7 /***************************************************************************
8  * Copyright (C) 2004 - 2011 Paul D Turner & The CEGUI Development Team
9  *
10  * Permission is hereby granted, free of charge, to any person obtaining
11  * a copy of this software and associated documentation files (the
12  * "Software"), to deal in the Software without restriction, including
13  * without limitation the rights to use, copy, modify, merge, publish,
14  * distribute, sublicense, and/or sell copies of the Software, and to
15  * permit persons to whom the Software is furnished to do so, subject to
16  * the following conditions:
17  *
18  * The above copyright notice and this permission notice shall be
19  * included in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24  * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
25  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
26  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
27  * OTHER DEALINGS IN THE SOFTWARE.
28  ***************************************************************************/
29 #ifndef _CEGUIResourceProvider_h_
30 #define _CEGUIResourceProvider_h_
31 
32 #include "CEGUI/Base.h"
33 #include "CEGUI/DataContainer.h"
34 #include "CEGUI/String.h"
35 #include <vector>
36 
37 
38 // Start of CEGUI namespace section
39 namespace CEGUI
40 {
47 class CEGUIEXPORT ResourceProvider :
48  public AllocatedObject<ResourceProvider>
49 {
50 public:
51  /*************************************************************************
52  Construction and Destruction
53  *************************************************************************/
59 
64  virtual ~ResourceProvider(void) { }
65 
66  /*************************************************************************
67  Accessor functions
68  *************************************************************************/
69 
70 // /*!
71 // \brief
72 // Load XML data using InputSource objects.
73 //
74 // \param filename
75 // String containing a filename of the resource to be loaded.
76 //
77 // \param output
78 // Reference to a InputSourceContainer object to load the data into.
79 // */
80 // virtual void loadInputSourceContainer(const String& filename, InputSourceContainer& output) = 0;
81 
96  virtual void loadRawDataContainer(const String& filename, RawDataContainer& output, const String& resourceGroup) = 0;
97 
109 
117  const String& getDefaultResourceGroup(void) const { return d_defaultResourceGroup; }
118 
129  void setDefaultResourceGroup(const String& resourceGroup) { d_defaultResourceGroup = resourceGroup; }
130 
134  virtual size_t getResourceGroupFileNames(std::vector<String>& out_vec,
135  const String& file_pattern,
136  const String& resource_group) = 0;
137 protected:
139 };
140 
141 } // End of CEGUI namespace section
142 
143 #endif // end of guard _CEGUIResourceProvider_h_
Definition: MemoryAllocatedObject.h:109
ResourceProvider()
Constructor for the ResourceProvider class.
Definition: ResourceProvider.h:58
Abstract class that defines the required interface for all resource provider sub-classes.
Definition: ResourceProvider.h:47
virtual void unloadRawDataContainer(RawDataContainer &)
Unload raw binary data. This gives the resource provider a change to unload the data in its own way b...
Definition: ResourceProvider.h:108
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
virtual ~ResourceProvider(void)
Destructor for the ResourceProvider class.
Definition: ResourceProvider.h:64
String d_defaultResourceGroup
Default resource group identifier.
Definition: ResourceProvider.h:138
Class used as the databuffer for loading files throughout the library.
Definition: DataContainer.h:42
const String & getDefaultResourceGroup(void) const
Return the current default resource group identifier.
Definition: ResourceProvider.h:117
void setDefaultResourceGroup(const String &resourceGroup)
Set the default resource group identifier.
Definition: ResourceProvider.h:129
String class used within the GUI system.
Definition: String.h:62