diff --git a/src/drivers/win/common.cpp b/src/drivers/win/common.cpp index 7782af27..322db208 100644 --- a/src/drivers/win/common.cpp +++ b/src/drivers/win/common.cpp @@ -54,4 +54,9 @@ void AddExtensionIfMissing(std::string &name,const char * extension) { //If the extension(".????") is longer then 5 characters, it's probably part of the filename. If x == -1, wasn't found if ((x < (name.size() - 6)) || (x == -1)) name.append(extension); +} + +std::string GetPath(std::string filename) +{ + return filename.substr(0,filename.find_last_of("/\\") + 1); } \ No newline at end of file diff --git a/src/drivers/win/common.h b/src/drivers/win/common.h index edd42f22..08c0e984 100644 --- a/src/drivers/win/common.h +++ b/src/drivers/win/common.h @@ -54,4 +54,5 @@ void WindowBoundsCheckResize(int &windowPosX, int &windowPosY, int windowSizeX, void WindowBoundsCheckNoResize(int &windowPosX, int &windowPosY, long windowRight); void AddExtensionIfMissing(char * name,unsigned int maxsize,const char * extension); void AddExtensionIfMissing(std::string &name,const char * extension); +std::string GetPath(std::string filename); #endif