16 #include "boost/version.hpp"
74 <<
"Unexpectedly reached end of file for line " << iRecordNumber <<
" just after '" << iContext <<
"'";
78 <<
"Reading failed on line " << iRecordNumber <<
" just after '" << iContext <<
"'";
84 unsigned long iRecordNumber,
87 static const std::string kNewLine(
"start of new line");
104 oInfo.
name_ = pluginName;
108 while (iIn.peek() ==
'\n') {
115 struct CompPluginInfos {
123 unsigned long recordNumber = 0;
131 if (not
readline(iIn, iDirectory, recordNumber, info, pluginType)) {
134 iOut[pluginType].push_back(info);
137 for (CacheParser::CategoryToInfos::iterator it = iOut.begin(), itEnd = iOut.end(); it != itEnd; ++it) {
138 std::stable_sort(it->second.begin(), it->second.end(), CompPluginInfos());
146 for (CategoryToInfos::const_iterator it = iInfos.begin(); it != iInfos.end(); ++it) {
148 for (std::vector<PluginInfo>::const_iterator it2 = it->second.begin(); it2 != it->second.end(); ++it2) {
150 #if (BOOST_VERSION / 100000) >= 1 && ((BOOST_VERSION / 100) % 1000) >= 47
151 std::string loadable(it2->loadable_.filename().string());
156 ordered[loadable].push_back(
NameAndType(name, type));
159 write(ordered, oOut);
163 for (LoadableToPlugins::iterator it = iIn.begin(); it != iIn.end(); ++it) {
168 for (
std::vector<std::pair<std::string, std::string> >::iterator it2 = it->second.begin();
169 it2 != it->second.end();
177 unsigned long recordNumber = 0;
187 if (not
readline(iIn, empty, recordNumber, info, pat.second)) {
190 pat.first = info.
name_;
197 while (std::string::npos != (index = io.find_first_of(
" \t\n", index))) {
205 while (std::string::npos != (index = io.find_first_of(
'%', index))) {
static std::string & restoreSpaces(std::string &io)
std::map< std::string, std::vector< PluginInfo > > CategoryToInfos
static void read(std::istream &, const std::filesystem::path &iDirectory, CategoryToInfos &oOut)
std::pair< std::string, std::string > NameAndType
std::map< std::filesystem::path, NameAndTypes > LoadableToPlugins
std::filesystem::path loadable_
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)
static bool readline(std::istream &iIn, const std::filesystem::path &iDirectory, unsigned long iRecordNumber, PluginInfo &oInfo, std::string &oPluginType)