52 TwoDAMap::const_iterator twoda =
_twodas.find(name);
55 return *twoda->second;
61 std::pair<TwoDAMap::iterator, bool> result;
62 result =
_twodas.insert(std::make_pair(name, newTwoDA));
64 return *result.first->second;
68 GDAMap::const_iterator gda =
_gdas.find(name);
69 if (gda !=
_gdas.end())
77 std::pair<GDAMap::iterator, bool> result;
78 result =
_gdas.insert(std::make_pair(name, newGDA));
80 return *result.first->second;
84 GDAMap::const_iterator gda =
_gdas.find(prefix);
85 if (gda !=
_gdas.end())
93 std::pair<GDAMap::iterator, bool> result;
94 result =
_gdas.insert(std::make_pair(prefix, newGDA));
96 return *result.first->second;
100 TwoDAMap::iterator twoda =
_twodas.find(name);
110 TwoDAMap::iterator twoda =
_twodas.find(name);
119 GDAMap::iterator gda =
_gdas.find(name);
120 if (gda !=
_gdas.end())
129 GDAMap::iterator gda =
_gdas.find(prefix);
130 if (gda !=
_gdas.end())
139 GDAMap::iterator gda =
_gdas.find(name);
140 if (gda ==
_gdas.end())
159 e.
add(
"Failed loading 2DA \"%s\"", name.
c_str());
178 e.
add(
"Failed loading GDA \"%s\"", name.
c_str());
193 std::list<ResourceManager::ResourceID> gdas;
199 for (std::list<ResourceManager::ResourceID>::const_iterator g = gdas.begin(); g != gdas.end(); ++g) {
201 if (!g->name.toLower().beginsWith(prefix))
214 gda->add(stream.release());
221 e.
add(
"Failed loading multiple GDA \"%s\"", prefix.
c_str());
void addGDA(const Common::UString &name)
Add a certain GDA to the registry, reloading it if necessary.
Class to hold the two-dimensional array of a 2DA file.
#define ResMan
Shortcut for accessing the sound manager.
Table data, 2-dimensional text array.
void add(const char *s,...) GCC_PRINTF(2
Handling BioWare's GDAs (2DAs, two-dimensional array, within V4.0 GFFs).
void erase(typename std::map< Key, T *, Compare >::iterator position)
A class holding an UTF-8 string.
void reset(PointerType o=0)
Resets the pointer with the new value.
PointerType release()
Returns the plain pointer value and releases ScopedPtr.
void removeGDA(const Common::UString &name)
Remove a certain GDA from the registry.
TwoDAFile * load2DA(const Common::UString &name)
GDAFile * loadMGDA(Common::UString prefix)
Exception that provides a stack of explanations.
A simple scoped smart pointer template.
GDAFile * loadGDA(const Common::UString &name)
Basic exceptions to throw.
const char * c_str() const
Return the (utf8 encoded) string data.
#define DECLARE_SINGLETON(T)
Note that you need to use this macro from the global namespace.
const GDAFile & getMGDA(const Common::UString &prefix)
Get a certain multiple GDA, loading it if necessary.
Handling BioWare's 2DAs (two-dimensional array).
void remove2DA(const Common::UString &name)
Remove a certain 2DA from the registry.
bool empty() const
Is the string empty?
Basic reading stream interfaces.
void addMGDA(const Common::UString &prefix)
Add a certain multiple GDA to the registry, reloading it if necessary.
void add2DA(const Common::UString &name)
Add a certain 2DA to the registry, reloading it if necessary.
Basic type definitions to handle files used in BioWare's Aurora engine.
Table data, GFF'd 2DA, 2-dimensional text array.
const TwoDAFile & get2DA(const Common::UString &name)
Get a certain 2DA, loading it if necessary.
The global 2DA registry, holding all current 2DAs.
void makeLower()
Convert the string to lowercase.
const GDAFile & getGDA(const Common::UString &name)
Get a certain GDA, loading it if necessary.
The global resource manager for Aurora resources.
Class to hold the GFF'd two-dimensional array of a GDA file.