filesys::path filesys::stem(const path & p) { size_type n = 0, m = p.length() - extension(p).length(); if (p.find_last_of('/') != path::npos) { n = p.find_last_of('/') + 1; } if (p.find_last_of('\\') != path::npos) { n = std::max(n, p.find_last_of('\\') + 1); } return p.substr(n, m - n); }
//edgeGroup::addJourney() // sets given journey to given path // //pre: // -edgeGroup as been set with a basicEdgeGroup // -information contains information about journey to find // //post: // -given journey set to given path // //O(length of newPath) void edgeGroup::addJourney(int journeyNum, path const & newPath) { removeJourney(journeyNum); for(unsigned i = 0; i < newPath.length() - 1; i++) { edges[newPath.returnVertex(i)][newPath.returnVertex(i + 1)].addJourney(journeyNum); if(biSharing && !STATdirected) edges[newPath.returnVertex(i + 1)][newPath.returnVertex(i)].addJourney(journeyNum); } }