1
0
Fork 0

DBG: added FileHelper::GetFileName

This commit is contained in:
mrexodia 2016-11-21 10:16:05 +01:00
parent 45ddde5707
commit 6856990cc1
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
2 changed files with 8 additions and 1 deletions

View File

@ -96,4 +96,10 @@ bool FileHelper::ReadAllLines(const String & fileName, std::vector<String> & lin
if(line.length())
lines.push_back(line);
return true;
}
}
String FileHelper::GetFileName(const String & fileName)
{
auto last = strrchr(fileName.c_str(), '\\');
return last ? last + 1 : fileName;
}

View File

@ -11,6 +11,7 @@ public:
static bool ReadAllText(const String & fileName, String & content);
static bool WriteAllText(const String & fileName, const String & content);
static bool ReadAllLines(const String & fileName, std::vector<String> & lines, bool keepEmpty = false);
static String GetFileName(const String & fileName);
};
#endif //_FILEREADER_H