Ignore:
Timestamp:
02/03/16 22:59:30 (8 years ago)
Author:
Maciej Komosinski
Message:

Added a function to strip the path component from filename

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/stl-util.cpp

    r382 r460  
    151151}
    152152
     153string stripFileDir(const string& filename)
     154{
     155        size_t sep = filename.rfind(PATH_SEPARATOR_CHAR);
     156        if (sep == string::npos) return filename;
     157        return filename.substr(sep+1);
     158}
     159
    153160string getFileExt(const string& filename)
    154161{
Note: See TracChangeset for help on using the changeset viewer.