Add a GetPath() function to common.cpp since there seems to be a lot of variations of that code floating around the codebase.
This commit is contained in:
parent
12b816bcd6
commit
dd0d5df80b
|
@ -55,3 +55,8 @@ void AddExtensionIfMissing(std::string &name,const char * extension) {
|
||||||
if ((x < (name.size() - 6)) || (x == -1))
|
if ((x < (name.size() - 6)) || (x == -1))
|
||||||
name.append(extension);
|
name.append(extension);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GetPath(std::string filename)
|
||||||
|
{
|
||||||
|
return filename.substr(0,filename.find_last_of("/\\") + 1);
|
||||||
|
}
|
|
@ -54,4 +54,5 @@ void WindowBoundsCheckResize(int &windowPosX, int &windowPosY, int windowSizeX,
|
||||||
void WindowBoundsCheckNoResize(int &windowPosX, int &windowPosY, long windowRight);
|
void WindowBoundsCheckNoResize(int &windowPosX, int &windowPosY, long windowRight);
|
||||||
void AddExtensionIfMissing(char * name,unsigned int maxsize,const char * extension);
|
void AddExtensionIfMissing(char * name,unsigned int maxsize,const char * extension);
|
||||||
void AddExtensionIfMissing(std::string &name,const char * extension);
|
void AddExtensionIfMissing(std::string &name,const char * extension);
|
||||||
|
std::string GetPath(std::string filename);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue