Minor const-related code cleanup.

pull/3/head
Chris Laurel 2001-03-05 22:48:47 +00:00
parent 6215d145c8
commit d8b97ddc2f
4 changed files with 11 additions and 11 deletions

View File

@ -32,13 +32,13 @@ MeshManager::~MeshManager()
}
bool MeshManager::find(string name, Mesh** mesh)
bool MeshManager::find(const string& name, Mesh** mesh)
{
return findResource(name, (void**) mesh);
}
Mesh* MeshManager::load(string name)
Mesh* MeshManager::load(const string& name)
{
DPRINTF("Loading mesh: %s\n", name.c_str());
ContentType fileType = DetermineFileType(name);

View File

@ -24,8 +24,8 @@ class MeshManager : public ResourceManager
MeshManager(char* _baseDir) : ResourceManager(_baseDir) {};
~MeshManager();
bool find(string name, Mesh**);
Mesh* load(string name);
bool find(const string& name, Mesh**);
Mesh* load(const string& name);
};
#endif // _MESHMANAGER_H_

View File

@ -37,7 +37,7 @@ ResourceManager::~ResourceManager()
// in res and return true. Otherwise, leave res untouched and return false.
// find() can be safely called with res == NULL just to test whether or not
// the resource is resident.
bool ResourceManager::findResource(string name, void** res)
bool ResourceManager::findResource(const string& name, void** res)
{
ResourceTable::iterator iter = resources.find(name);
if (iter != resources.end())
@ -53,7 +53,7 @@ bool ResourceManager::findResource(string name, void** res)
}
void ResourceManager::addResource(string name, void* res)
void ResourceManager::addResource(const string& name, void* res)
{
resources.insert(ResourceTable::value_type(name, res));
}

View File

@ -19,17 +19,17 @@ class ResourceManager
{
public:
ResourceManager();
ResourceManager(string _baseDir);
ResourceManager(std::string _baseDir);
ResourceManager(char* _baseDir);
~ResourceManager();
protected:
bool findResource(string name, void**);
void addResource(string name, void*);
string baseDir;
bool findResource(const std::string& name, void**);
void addResource(const std::string& name, void*);
std::string baseDir;
private:
typedef std::map<string, void*> ResourceTable;
typedef std::map<std::string, void*> ResourceTable;
ResourceTable resources;
};