summaryrefslogtreecommitdiffstats
path: root/pokemod/Path.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pokemod/Path.cpp')
-rw-r--r--pokemod/Path.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/pokemod/Path.cpp b/pokemod/Path.cpp
index 2e7e8a20..244e71e2 100644
--- a/pokemod/Path.cpp
+++ b/pokemod/Path.cpp
@@ -57,7 +57,7 @@ bool PokeGen::PokeMod::Path::DoesExist()
return true;
}
-bool PokeGen::PokeMod::Path::HasExtension(const String &ext)
+bool PokeGen::PokeMod::Path::HasExtension(const String &ext) const
{
size_t pos = rfind('.');
bool ret = true;
@@ -69,6 +69,15 @@ bool PokeGen::PokeMod::Path::HasExtension(const String &ext)
return ret;
}
+PokeGen::PokeMod::String PokeGen::PokeMod::Path::GetFilename() const
+{
+ size_t pos = rfind('/');
+ String fileName(substr(pos + 1));
+ if ((pos == npos) || (pos + 1 == length()))
+ return "";
+ return fileName;
+}
+
bool PokeGen::PokeMod::Path::CopyTo(const String &dest)
{
if (!DoesExist())