| 51 | } |
| 52 | |
| 53 | void checkAndLog(std::shared_ptr<TreeItem> item, |
| 54 | const std::string & formatName, |
| 55 | const std::string & symbolName, |
| 56 | const Options & options, |
| 57 | int64_t value, |
| 58 | const std::string & code) |
| 59 | { |
| 60 | CheckResult checkResult; |
| 61 | for (auto &check : options.checkList) |
| 62 | { |
| 63 | checkResult = check->checkValue(value); |
| 64 | if (!checkResult) |
| 65 | break; |
| 66 | } |
| 67 | |
| 68 | if (item && !options.loggingDisabled) |
| 69 | { |
| 70 | std::string meaning = options.meaningString; |
| 71 | if (options.meaningMap.count(int64_t(value)) > 0) |
| 72 | meaning = options.meaningMap.at(value); |
| 73 | |
| 74 | const bool isError = !checkResult; |
| 75 | if (isError) |
| 76 | meaning += " " + checkResult.errorMessage; |
| 77 | item->createChildItem( |
| 78 | symbolName, value, formatCoding(formatName, code.size()), code, meaning, isError); |
| 79 | } |
| 80 | if (!checkResult && checkResult.checkLevel == CheckLevel::Error) |
| 81 | throw std::logic_error(checkResult.errorMessage); |
| 82 | } |
| 83 | |
| 84 | void checkAndLog(std::shared_ptr<TreeItem> item, |
| 85 | const std::string & byteName, |
no test coverage detected