IOS: Adds an helper function
This commit is contained in:
parent
ef2903c509
commit
a8d65195ce
2 changed files with 17 additions and 0 deletions
|
@ -1056,6 +1056,12 @@ void splitFilename(const std::string &fileName, std::string &name, std::string &
|
||||||
ext = (dot == std::string::npos) ? std::string() : fileName.substr(dot + 1);
|
ext = (dot == std::string::npos) ? std::string() : fileName.substr(dot + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string basename(const std::string &fileName) {
|
||||||
|
const std::string::size_type slash = fileName.find_last_of('/');
|
||||||
|
if (slash == std::string::npos) return fileName;
|
||||||
|
return fileName.substr(slash + 1);
|
||||||
|
}
|
||||||
|
|
||||||
bool producesObjectFile(const std::string &fileName) {
|
bool producesObjectFile(const std::string &fileName) {
|
||||||
std::string n, ext;
|
std::string n, ext;
|
||||||
splitFilename(fileName, n, ext);
|
splitFilename(fileName, n, ext);
|
||||||
|
|
|
@ -315,6 +315,17 @@ std::string convertPathToWin(const std::string &path);
|
||||||
*/
|
*/
|
||||||
void splitFilename(const std::string &fileName, std::string &name, std::string &ext);
|
void splitFilename(const std::string &fileName, std::string &name, std::string &ext);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the basename of a path.
|
||||||
|
* examples:
|
||||||
|
* a/b/c/d.ext -> d.ext
|
||||||
|
* d.ext -> d.ext
|
||||||
|
*
|
||||||
|
* @param fileName Filename
|
||||||
|
* @return The basename
|
||||||
|
*/
|
||||||
|
std::string basename(const std::string &fileName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks whether the given file will produce an object file or not.
|
* Checks whether the given file will produce an object file or not.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue