CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/FWCore/PluginManager/src/standard.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:     PluginManager
00004 // Class  :     standard
00005 // 
00006 // Implementation:
00007 //     <Notes on implementation>
00008 //
00009 // Original Author:  Chris Jones
00010 //         Created:  Sat Apr  7 17:10:11 EDT 2007
00011 // $Id: standard.cc,v 1.5 2010/11/08 16:23:31 eulisse Exp $
00012 //
00013 
00014 // system include files
00015 
00016 // user include files
00017 #include "FWCore/PluginManager/interface/standard.h"
00018 
00019 namespace edmplugin {
00020   namespace standard {
00021 
00022     PluginManager::Config config()
00023   {
00024       PluginManager::Config returnValue;
00025       
00026 #ifdef __APPLE__
00027       const char *path = getenv ("DYLD_FALLBACK_LIBRARY_PATH");
00028 #else
00029       const char *path = getenv ("LD_LIBRARY_PATH");
00030 #endif
00031       if (! path) path = "";
00032       
00033       std::string spath(path);
00034       std::string::size_type last=0;
00035       std::string::size_type i=0;
00036       std::vector<std::string> paths;
00037       while( (i=spath.find_first_of(':',last))!=std::string::npos) {
00038         paths.push_back(spath.substr(last,i-last));
00039         last = i+1;
00040         //std::cout <<paths.back()<<std::endl;
00041       }
00042       paths.push_back(spath.substr(last,std::string::npos));
00043       returnValue.searchPath(paths);
00044       
00045       return returnValue;
00046   }
00047     
00048     const boost::filesystem::path& cachefileName() {
00049       static const boost::filesystem::path s_path(".edmplugincache");
00050       return s_path;
00051     }
00052     
00053     
00054     const std::string& pluginPrefix() {
00055       static const std::string s_prefix("plugin");
00056       return s_prefix;
00057     }
00058     
00059   }
00060 }