Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:13:14

0001 #include "FWCore/Utilities/interface/stemFromPath.h"
0002 
0003 namespace edm {
0004   std::string_view stemFromPath(std::string_view path) {
0005     auto begin = path.rfind('/');
0006     if (begin == std::string_view::npos) {
0007       begin = path.rfind(':');
0008       if (begin == std::string_view::npos) {
0009         // shouldn't really happen?
0010         begin = 0;
0011       } else {
0012         begin += 1;
0013       }
0014     } else {
0015       begin += 1;
0016     }
0017     auto end = path.find('.', begin);
0018     return path.substr(begin, end - begin);
0019   }
0020 }  // namespace edm