Lines Matching refs:region
56 std::string ToValueString(const BinaryRegion ®ion, const uint8_t *binary) { in ToValueString() argument
59 const T val = ReadScalar<T>(binary + region.offset); in ToValueString()
60 const uint64_t start_index = region.offset + region.length - 1; in ToValueString()
61 for (uint64_t i = 0; i < region.length; ++i) { in ToValueString()
71 std::string ToValueString<std::string>(const BinaryRegion ®ion, in ToValueString() argument
73 return std::string(reinterpret_cast<const char *>(binary + region.offset), in ToValueString()
74 static_cast<size_t>(region.array_length)); in ToValueString()
77 static std::string ToValueString(const BinaryRegion ®ion, in ToValueString() argument
82 if (region.array_length) { in ToValueString()
83 if (region.type == BinaryRegionType::Uint8 || in ToValueString()
84 region.type == BinaryRegionType::Unknown) { in ToValueString()
86 for (uint64_t i = 0; i < region.array_length; ++i) { in ToValueString()
87 const uint8_t c = *(binary + region.offset + i); in ToValueString()
91 } else if (region.type == BinaryRegionType::Char) { in ToValueString()
93 return ToValueString<std::string>(region, binary); in ToValueString()
97 switch (region.type) { in ToValueString()
99 return ToValueString<uint32_t>(region, binary); in ToValueString()
100 case BinaryRegionType::Int32: return ToValueString<int32_t>(region, binary); in ToValueString()
102 return ToValueString<uint16_t>(region, binary); in ToValueString()
103 case BinaryRegionType::Int16: return ToValueString<int16_t>(region, binary); in ToValueString()
104 case BinaryRegionType::Bool: return ToValueString<bool>(region, binary); in ToValueString()
105 case BinaryRegionType::Uint8: return ToValueString<uint8_t>(region, binary); in ToValueString()
106 case BinaryRegionType::Char: return ToValueString<char>(region, binary); in ToValueString()
108 case BinaryRegionType::Int8: return ToValueString<int8_t>(region, binary); in ToValueString()
109 case BinaryRegionType::Int64: return ToValueString<int64_t>(region, binary); in ToValueString()
111 return ToValueString<uint64_t>(region, binary); in ToValueString()
112 case BinaryRegionType::Double: return ToValueString<double>(region, binary); in ToValueString()
113 case BinaryRegionType::Float: return ToValueString<float>(region, binary); in ToValueString()
114 case BinaryRegionType::UType: return ToValueString<uint8_t>(region, binary); in ToValueString()
118 s += ToValueString<uint32_t>(region, binary); in ToValueString()
121 s += ToValueString<int32_t>(region, binary); in ToValueString()
124 s += ToValueString<uint16_t>(region, binary); in ToValueString()
132 if (IsOffset(region.type)) { in ToValueString()
134 s += ToHex(region.points_to_offset, output_config.offset_max_char); in ToValueString()
147 static std::string GenerateTypeString(const BinaryRegion ®ion) { in GenerateTypeString() argument
148 return ToString(region.type) + in GenerateTypeString()
149 ((region.array_length) in GenerateTypeString()
150 ? "[" + std::to_string(region.array_length) + "]" in GenerateTypeString()
259 static std::string GenerateDocumentation(const BinaryRegion ®ion, in GenerateDocumentation() argument
281 ss << GenerateTypeString(region); in GenerateDocumentation()
287 if (region.array_length) { in GenerateDocumentation()
292 const std::string value = ToValueString(region, binary, output_config); in GenerateDocumentation()
304 ss << ToValueString(region, binary, output_config); in GenerateDocumentation()
311 s += GenerateComment(region.comment, section); in GenerateDocumentation()
316 static std::string GenerateRegion(const BinaryRegion ®ion, in GenerateRegion() argument
323 for (uint64_t i = 0; i < region.length; ++i) { in GenerateRegion()
329 s += ToHex(region.offset + i, output_config.offset_max_char); in GenerateRegion()
336 s += ToHex(binary[region.offset + i]); in GenerateRegion()
340 i + 1 == region.length) { in GenerateRegion()
341 if (i + 1 == region.length) { in GenerateRegion()
355 s += GenerateDocumentation(region, section, binary, doc_continuation, in GenerateRegion()
376 for (const BinaryRegion ®ion : section.regions) { in GenerateSection() local
377 s += GenerateRegion(region, section, binary, output_config); in GenerateSection()
400 for (const auto ®ion : section.second.regions) { in Generate() local
401 std::string s = GenerateTypeString(region); in Generate()
407 if (!region.array_length) { in Generate()
408 s = ToValueString(region, binary_, output_config); in Generate()