COMPOSER: Split out filename mangling into a separate function.

This commit is contained in:
Alyssa Milburn 2011-08-13 22:11:14 +02:00
parent c3339c15fa
commit bdc24b6565
2 changed files with 6 additions and 0 deletions

View File

@ -275,6 +275,11 @@ Common::String ComposerEngine::getStringFromConfig(const Common::String &section
Common::String ComposerEngine::getFilename(const Common::String &section, uint id) {
Common::String key = Common::String::format("%d", id);
Common::String filename = getStringFromConfig(section, key);
return mangleFilename(filename);
}
Common::String ComposerEngine::mangleFilename(Common::String filename) {
while (filename.size() && (filename[0] == '~' || filename[0] == ':' || filename[0] == '\\'))
filename = filename.c_str() + 1;

View File

@ -172,6 +172,7 @@ private:
Common::String getStringFromConfig(const Common::String &section, const Common::String &key);
Common::String getFilename(const Common::String &section, uint id);
Common::String mangleFilename(Common::String filename);
void loadLibrary(uint id);
void unloadLibrary(uint id);