#include "components/web_package/input_reader.h"
#include "base/containers/contains.h"
#include "base/functional/overloaded.h"
#include "base/numerics/checked_math.h"
#include "base/strings/string_util.h"
#include "base/types/cxx23_to_underlying.h"
#include "components/cbor/constants.h"
#include "components/cbor/values.h"
namespace web_package {
namespace {
constexpr std::array kAcceptedCBORTypes = …;
std::optional<int64_t> DecodeValueToNegative(uint64_t value) { … }
std::optional<int64_t> DecodeValueToUnsigned(uint64_t value) { … }
}
InputReader::InputReader(base::span<const uint8_t> buf) : … { … }
InputReader::~InputReader() = default;
std::optional<uint8_t> InputReader::ReadByte() { … }
std::optional<base::span<const uint8_t>> InputReader::ReadBytes(size_t n) { … }
std::optional<std::string_view> InputReader::ReadString(size_t n) { … }
std::optional<uint64_t> InputReader::ReadCBORHeader(CBORType expected_type) { … }
std::optional<CBORHeader> InputReader::ReadCBORHeader() { … }
std::optional<std::pair<CBORType, uint64_t>>
InputReader::ReadTypeAndArgument() { … }
}