chromium/components/web_package/input_reader.cc

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// This array must be kept in sync with the `CBORType` enum.
constexpr std::array kAcceptedCBORTypes =;

std::optional<int64_t> DecodeValueToNegative(uint64_t value) {}

std::optional<int64_t> DecodeValueToUnsigned(uint64_t value) {}

}  // namespace

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() {}

// https://datatracker.ietf.org/doc/html/rfc8949.html#section-3
std::optional<std::pair<CBORType, uint64_t>>
InputReader::ReadTypeAndArgument() {}

}  // namespace web_package