| 3091 | } |
| 3092 | |
| 3093 | std::pair<simplecpp::FileData *, bool> simplecpp::FileDataCache::tryload(FileDataCache::name_map_type::iterator &name_it, const simplecpp::DUI &dui, std::vector<std::string> &filenames, simplecpp::OutputList *outputList) |
| 3094 | { |
| 3095 | const std::string &path = name_it->first; |
| 3096 | FileID fileId; |
| 3097 | |
| 3098 | if (!getFileId(path, fileId)) |
| 3099 | return {nullptr, false}; |
| 3100 | |
| 3101 | const auto id_it = mIdMap.find(fileId); |
| 3102 | if (id_it != mIdMap.end()) { |
| 3103 | name_it->second = id_it->second; |
| 3104 | return {id_it->second, false}; |
| 3105 | } |
| 3106 | |
| 3107 | auto *const data = new FileData {path, TokenList(path, filenames, outputList)}; |
| 3108 | |
| 3109 | if (dui.removeComments) |
| 3110 | data->tokens.removeComments(); |
| 3111 | |
| 3112 | name_it->second = data; |
| 3113 | mIdMap.emplace(fileId, data); |
| 3114 | mData.emplace_back(data); |
| 3115 | |
| 3116 | return {data, true}; |
| 3117 | } |
| 3118 | |
| 3119 | std::pair<simplecpp::FileData *, bool> simplecpp::FileDataCache::get(const std::string &sourcefile, const std::string &header, const simplecpp::DUI &dui, bool systemheader, std::vector<std::string> &filenames, simplecpp::OutputList *outputList) |
| 3120 | { |
nothing calls this directly
no test coverage detected