1 /* GemRB - Infinity Engine Emulator
2 * Copyright (C) 2003 The GemRB Project
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 #ifndef RESOURCEMANGER_H
22 #define RESOURCEMANGER_H
31 #ifdef _MSC_VER // No SFINAE
32 #include "ResourceSource.h"
40 class GEM_EXPORT ResourceManager
{
46 * Add ResourceSource to search path
47 * @param[in] path Path to be used for source.
48 * Note: This is modified by ResolveFilePath.
49 * @param[in] description Description of the source.
50 * @param[in] type Plugin type used for source.
52 bool AddSource(const char *path
, const char *description
, PluginID type
);
54 /** returns true if resource exists */
55 bool Exists(const char *ResRef
, SClass_ID type
, bool silent
=false) const;
56 /** returns true if resource exists */
57 bool Exists(const char *ResRef
, const TypeID
*type
, bool silent
=false) const;
59 /** Returns stream associated to given resource */
60 DataStream
* GetResource(const char* resname
, SClass_ID type
, bool silent
= false) const;
61 /** Returns Resource object associated to given resource */
62 Resource
* GetResource(const char* resname
, const TypeID
*type
, bool silent
= false) const;
65 std::vector
<Holder
<ResourceSource
> > searchPath
;