File indexing completed on 2024-04-06 12:12:59
0001 #ifndef FWCore_PluginManager_CacheParser_h
0002 #define FWCore_PluginManager_CacheParser_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #include <filesystem>
0028 #include <iosfwd>
0029 #include <string>
0030 #include <map>
0031 #include <vector>
0032
0033 #include "FWCore/PluginManager/interface/PluginInfo.h"
0034
0035
0036 class TestCacheParser;
0037
0038 namespace edmplugin {
0039 class CacheParser {
0040 public:
0041 typedef std::map<std::string, std::vector<PluginInfo> > CategoryToInfos;
0042 typedef std::pair<std::string, std::string> NameAndType;
0043 typedef std::vector<NameAndType> NameAndTypes;
0044 typedef std::map<std::filesystem::path, NameAndTypes> LoadableToPlugins;
0045
0046 CacheParser(const CacheParser&) = delete;
0047 const CacheParser& operator=(const CacheParser&) = delete;
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057
0058 static void read(std::istream&, const std::filesystem::path& iDirectory, CategoryToInfos& oOut);
0059 static void write(const CategoryToInfos&, std::ostream&);
0060
0061 static void read(std::istream&, LoadableToPlugins& oOut);
0062 static void write(LoadableToPlugins& iIn, std::ostream&);
0063
0064 private:
0065
0066 friend class ::TestCacheParser;
0067
0068 static bool readline(std::istream& iIn,
0069 const std::filesystem::path& iDirectory,
0070 unsigned long iRecordNumber,
0071 PluginInfo& oInfo,
0072 std::string& oPluginType);
0073 static std::string& replaceSpaces(std::string& io);
0074 static std::string& restoreSpaces(std::string& io);
0075
0076
0077 };
0078
0079 }
0080 #endif