20 lines
388 B
C++
20 lines
388 B
C++
#include "PathHelper.h"
|
|
#include "Defines.h"
|
|
#include <string>
|
|
|
|
|
|
std::string PathHelper::GetExtension(std::string path)
|
|
{
|
|
return path.substr(path.find_last_of(".") + 1);
|
|
}
|
|
|
|
std::string PathHelper::GetFilename(std::string path)
|
|
{
|
|
const size_t last_slash_idx = path.find_last_of("\\/");
|
|
if (std::string::npos != last_slash_idx)
|
|
{
|
|
path.erase(0, last_slash_idx + 1);
|
|
}
|
|
return path;
|
|
}
|