#include "annotated_binary_text_gen.h"
#include <algorithm>
#include <cstdint>
#include <fstream>
#include <ostream>
#include <sstream>
#include <string>
#include "binary_annotator.h"
#include "flatbuffers/base.h"
#include "flatbuffers/util.h"
namespace flatbuffers {
namespace {
struct OutputConfig { … };
static std::string ToString(const BinarySectionType type) { … }
static bool IsOffset(const BinaryRegionType type) { … }
template<typename T> std::string ToString(T value) { … }
template<typename T>
std::string ToValueString(const BinaryRegion ®ion, const uint8_t *binary) { … }
template<>
std::string ToValueString<std::string>(const BinaryRegion ®ion,
const uint8_t *binary) { … }
static std::string ToValueString(const BinaryRegion ®ion,
const uint8_t *binary,
const OutputConfig &output_config) { … }
struct DocContinuation { … };
static std::string GenerateTypeString(const BinaryRegion ®ion) { … }
static std::string GenerateComment(const BinaryRegionComment &comment,
const BinarySection &) { … }
static void GenerateDocumentation(std::ostream &os, const BinaryRegion ®ion,
const BinarySection §ion,
const uint8_t *binary,
DocContinuation &continuation,
const OutputConfig &output_config) { … }
static void GenerateRegion(std::ostream &os, const BinaryRegion ®ion,
const BinarySection §ion, const uint8_t *binary,
const OutputConfig &output_config) { … }
static void GenerateSection(std::ostream &os, const BinarySection §ion,
const uint8_t *binary,
const OutputConfig &output_config) { … }
}
bool AnnotatedBinaryTextGenerator::Generate(
const std::string &filename, const std::string &schema_filename,
const std::string &output_filename) { … }
}