scanclrmake/src/crparser.cxx
// ===========================================================================
// Get the last name out of the path.  The resulting name will contain
// no slashes or backslashes.
//
Get the last name out of the path.  The resulting name will contain
no slashes or backslashes.
Get the last name out of the path . The resulting name will contain no slashes or backslashes .
string fileOf(const string &path)
{
    Regexp filex("(^|/|\\\\)([^/\\\\]+)[/\\\\]*$");
    string file = "proj";
    if (filex.Match(path.c_str(), path.size(), 0) >= 0) {
        int bom = filex.BeginningOfMatch(2);
	int len = filex.EndOfMatch(2) - bom;
	file = path.substr(bom, len);
    }
    return file;
}
string fileOf ( const string & path ) { Regexp filex ( " \\ \\ \\ \\ \\ \\ " ) ; string file = " " ; if ( filex . Match ( path . c_str ( ) , path . size ( ) , 0 ) >= 0 ) { int bom = filex . BeginningOfMatch ( 2 ) ; int len = filex . EndOfMatch ( 2 ) - bom ; file = path . substr ( bom , len ) ; } return file ; }
Get the last name out of the path.
Get the last name out of the path .
// Will fail if there's no non-empty name.