17 #include "boost/version.hpp"
73 unsigned long iRecordNumber,
74 const std::string& iContext)
77 throw cms::Exception(
"PluginCacheParseFailed")<<
"Unexpectedly reached end of file for line "
78 <<iRecordNumber<<
" just after '"<<iContext<<
"'";
81 throw cms::Exception(
"PluginCacheParseFailed")<<
"Reading failed on line "<<iRecordNumber <<
" just after '"<<iContext<<
"'";
87 unsigned long iRecordNumber,
PluginInfo &oInfo, std::string& oPluginType)
89 static const std::string kNewLine(
"start of new line");
91 std::string pluginName;
93 if(iIn.eof()) {
return false;}
104 oInfo.
name_ = pluginName;
109 while(iIn.peek() ==
'\n') {
116 struct CompPluginInfos {
130 unsigned long recordNumber=0;
132 std::string pluginType;
138 if( not
readline(iIn,iDirectory,recordNumber,info,pluginType) ) {
141 iOut[pluginType].push_back(info);
144 for(CacheParser::CategoryToInfos::iterator it = iOut.begin(), itEnd=iOut.end();
147 std::stable_sort(it->second.begin(),it->second.end(), CompPluginInfos());
157 for(CategoryToInfos::const_iterator it = iInfos.begin();
160 std::string
type(it->first);
161 for(std::vector<PluginInfo>::const_iterator it2=it->second.begin();
162 it2 != it->second.end();
165 #if (BOOST_VERSION / 100000) >= 1 && ((BOOST_VERSION / 100) % 1000) >= 47
166 std::string loadable(it2->loadable_.filename().string());
168 std::string loadable(it2->loadable_.filename());
170 std::string
name(it2->name_);
171 ordered[loadable].push_back(
NameAndType(name,type));
180 for( LoadableToPlugins::iterator it = iIn.begin();
183 std::string loadable(it->first.string());
187 for(std::vector<std::pair<std::string,std::string> >::iterator it2 = it->second.begin();
188 it2 != it->second.end();
198 unsigned long recordNumber=0;
200 std::string pluginType;
208 if( not
readline(iIn,empty,recordNumber,info,pat.second) ) {
211 pat.first = info.
name_;
220 while(std::string::npos != (index = io.find_first_of(
" \t\n",index))) {
229 while(std::string::npos != (index = io.find_first_of(
"%",index))) {
static std::string & restoreSpaces(std::string &io)
std::pair< std::string, std::string > NameAndType
std::map< std::string, std::vector< PluginInfo > > CategoryToInfos
static bool readline(std::istream &iIn, const boost::filesystem::path &iDirectory, unsigned long iRecordNumber, PluginInfo &oInfo, std::string &oPluginType)
std::map< boost::filesystem::path, NameAndTypes > LoadableToPlugins
const T & max(const T &a, const T &b)
static void checkForError(const std::istream &iIn, unsigned long iRecordNumber, const std::string &iContext)
static void write(const CategoryToInfos &, std::ostream &)
void sort_all(RandomAccessSequence &s)
wrappers for std::sort
static std::string & replaceSpaces(std::string &io)
boost::filesystem::path loadable_
static void read(std::istream &, const boost::filesystem::path &iDirectory, CategoryToInfos &oOut)