Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:12:59

0001 // -*- C++ -*-
0002 //
0003 // Package:     PluginManager
0004 // Class  :     standard
0005 //
0006 // Implementation:
0007 //     <Notes on implementation>
0008 //
0009 // Original Author:  Chris Jones
0010 //         Created:  Sat Apr  7 17:10:11 EDT 2007
0011 //
0012 
0013 // system include files
0014 
0015 // user include files
0016 #include "FWCore/PluginManager/interface/standard.h"
0017 
0018 namespace edmplugin {
0019   namespace standard {
0020 
0021     PluginManager::Config config() {
0022       PluginManager::Config returnValue;
0023 
0024 #ifdef __APPLE__
0025       const char* path = std::getenv("DYLD_FALLBACK_LIBRARY_PATH");
0026 #else
0027       const char* path = std::getenv("LD_LIBRARY_PATH");
0028 #endif
0029       if (!path)
0030         path = "";
0031 
0032       std::string spath(path);
0033       std::string::size_type last = 0;
0034       std::string::size_type i = 0;
0035       std::vector<std::string> paths;
0036       while ((i = spath.find_first_of(':', last)) != std::string::npos) {
0037         paths.push_back(spath.substr(last, i - last));
0038         last = i + 1;
0039         //std::cout <<paths.back()<<std::endl;
0040       }
0041       paths.push_back(spath.substr(last, std::string::npos));
0042       returnValue.searchPath(paths);
0043 
0044       return returnValue;
0045     }
0046 
0047     const std::filesystem::path& cachefileName() {
0048       static const std::filesystem::path s_path(".edmplugincache");
0049       return s_path;
0050     }
0051 
0052     const std::filesystem::path& poisonedCachefileName() {
0053       static const std::filesystem::path s_path(".poisonededmplugincache");
0054       return s_path;
0055     }
0056 
0057     const std::string& pluginPrefix() {
0058       static const std::string s_prefix("plugin");
0059       return s_prefix;
0060     }
0061 
0062   }  // namespace standard
0063 }  // namespace edmplugin