16 #include "boost/version.hpp"
72 unsigned long iRecordNumber,
76 throw cms::Exception(
"PluginCacheParseFailed")<<
"Unexpectedly reached end of file for line "
77 <<iRecordNumber<<
" just after '"<<iContext<<
"'";
80 throw cms::Exception(
"PluginCacheParseFailed")<<
"Reading failed on line "<<iRecordNumber <<
" just after '"<<iContext<<
"'";
88 static const std::string kNewLine(
"start of new line");
92 if(iIn.eof()) {
return false;}
103 oInfo.
name_ = pluginName;
108 while(iIn.peek() ==
'\n') {
115 struct CompPluginInfos {
129 unsigned long recordNumber=0;
137 if( not
readline(iIn,iDirectory,recordNumber,info,pluginType) ) {
140 iOut[pluginType].push_back(info);
143 for(CacheParser::CategoryToInfos::iterator it = iOut.begin(), itEnd=iOut.end();
146 std::stable_sort(it->second.begin(),it->second.end(), CompPluginInfos());
156 for(CategoryToInfos::const_iterator it = iInfos.begin();
160 for(std::vector<PluginInfo>::const_iterator it2=it->second.begin();
161 it2 != it->second.end();
164 #if (BOOST_VERSION / 100000) >= 1 && ((BOOST_VERSION / 100) % 1000) >= 47
165 std::string loadable(it2->loadable_.filename().string());
170 ordered[loadable].push_back(
NameAndType(name,type));
179 for( LoadableToPlugins::iterator it = iIn.begin();
186 for(std::vector<std::pair<std::string,std::string> >::iterator it2 = it->second.begin();
187 it2 != it->second.end();
197 unsigned long recordNumber=0;
207 if( not
readline(iIn,empty,recordNumber,info,pat.second) ) {
210 pat.first = info.
name_;
219 while(std::string::npos != (index = io.find_first_of(
" \t\n",index))) {
228 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
tuple path
else: Piece not in the list, fine.
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)