mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-05 00:36:57 +00:00
GOB: Add setExtension()
svn-id: r55639
This commit is contained in:
parent
ec288c0603
commit
078162c665
@ -518,6 +518,23 @@ void Util::deleteList(List *list) {
|
||||
delete list;
|
||||
}
|
||||
|
||||
char *Util::setExtension(char *str, const char *ext) {
|
||||
char *dot = strrchr(str, '.');
|
||||
if (dot)
|
||||
*dot = '\0';
|
||||
|
||||
strcat(str, ext);
|
||||
return str;
|
||||
}
|
||||
|
||||
Common::String Util::setExtension(const Common::String &str, const Common::String &ext) {
|
||||
const char *dot = strrchr(str.c_str(), '.');
|
||||
if (dot)
|
||||
return Common::String(str.c_str(), dot - str.c_str()) + ext;
|
||||
|
||||
return str + ext;
|
||||
}
|
||||
|
||||
/* NOT IMPLEMENTED */
|
||||
void Util::checkJoystick() {
|
||||
_vm->_global->_useJoystick = 0;
|
||||
|
@ -131,6 +131,9 @@ public:
|
||||
static void listDropFront(List *list);
|
||||
static void deleteList(List *list);
|
||||
|
||||
static char *setExtension(char *str, const char *ext);
|
||||
static Common::String setExtension(const Common::String &str, const Common::String &ext);
|
||||
|
||||
Util(GobEngine *vm);
|
||||
|
||||
protected:
|
||||
|
Loading…
Reference in New Issue
Block a user