MCPcopy Create free account
hub / github.com/IENT/YUView / checkAndLog

Function checkAndLog

YUViewLib/src/parser/common/SubByteReaderLogging.cpp:53–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void 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
84void checkAndLog(std::shared_ptr<TreeItem> item,
85 const std::string & byteName,

Callers 9

readBitsMethod · 0.85
readFlagMethod · 0.85
readUEVMethod · 0.85
readSEVMethod · 0.85
readLEB128Method · 0.85
readNSMethod · 0.85
readSUMethod · 0.85
readBytesMethod · 0.85
logCalculatedValueMethod · 0.85

Calls 6

formatCodingFunction · 0.85
checkValueMethod · 0.80
createChildItemMethod · 0.80
to_stringFunction · 0.50
atMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected