#include "src/trace_processor/importers/proto/pigweed_detokenizer.h"
#include <array>
#include <cctype>
#include <cstring>
#include "perfetto/ext/base/flat_hash_map.h"
#include "perfetto/ext/base/status_or.h"
#include "perfetto/ext/base/string_utils.h"
#include "perfetto/protozero/field.h"
static constexpr uint32_t kDateRemovedNever = …;
static constexpr uint32_t kFormatBufferSize = …;
static constexpr std::array<uint8_t, 8> kHeaderPrefix = …;
struct Header { … };
struct Entry { … };
static constexpr uint32_t ReadUint32(const uint8_t* bytes) { … }
namespace perfetto::trace_processor::pigweed {
PigweedDetokenizer CreateNullDetokenizer() { … }
base::StatusOr<PigweedDetokenizer> CreateDetokenizer(
const protozero::ConstBytes& bytes) { … }
PigweedDetokenizer::PigweedDetokenizer(
base::FlatHashMap<uint32_t, FormatString> tokens)
: … { … }
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
#endif
base::StatusOr<DetokenizedString> PigweedDetokenizer::Detokenize(
const protozero::ConstBytes& bytes) const { … }
#if defined(__GNUC__) || defined(__clang__)
#pragma GCC diagnostic pop
#endif
DetokenizedString::DetokenizedString(const uint32_t token,
FormatString format_string)
: … { … }
DetokenizedString::DetokenizedString(
const uint32_t token,
FormatString format_string,
std::vector<std::variant<int64_t, uint64_t, double>> args,
std::vector<std::string> args_formatted)
: … { … }
std::string DetokenizedString::Format() const { … }
static size_t SkipFlags(std::string fmt, size_t ix) { … }
static size_t SkipAsteriskOrInteger(std::string fmt, size_t ix) { … }
static std::array<char, 2> ReadLengthModifier(std::string fmt, size_t ix) { … }
FormatString::FormatString(std::string format) : … { … }
}