// 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. #ifndef COMPONENTS_WEB_PACKAGE_INPUT_READER_H_ #define COMPONENTS_WEB_PACKAGE_INPUT_READER_H_ #include <optional> #include <string_view> #include "base/containers/span.h" #include "base/containers/span_reader.h" #include "base/memory/stack_allocated.h" #include "base/types/id_type.h" #include "third_party/abseil-cpp/absl/types/variant.h" namespace web_package { // https://datatracker.ietf.org/doc/html/rfc8949.html#section-3.1 enum class CBORType { … }; struct CBORHeader { … }; // The maximum length of the CBOR item header (type and argument). // https://datatracker.ietf.org/doc/html/rfc8949.html#section-3 // When the additional information (the low-order 5 bits of the first // byte) is 27, the argument's value is held in the following 8 bytes. constexpr uint64_t kMaxCBORItemHeaderSize = …; // A utility class for reading various values from input buffer. class InputReader { … }; } // namespace web_package #endif // COMPONENTS_WEB_PACKAGE_INPUT_READER_H_