blob: bb2f1b08ad9bab9eb1e5072a70b49033a654ed6c [file] [edit]
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
#ifndef THIRD_PARTY_CREDENTIO_JUMBF_INTERNAL_CONSUME_BOX_H_
#define THIRD_PARTY_CREDENTIO_JUMBF_INTERNAL_CONSUME_BOX_H_
#include "absl/status/statusor.h"
#include "absl/strings/string_view.h"
#include "jumbf/internal/intermediate.h"
namespace jumbf_internal {
// Consumes the first box in `input`. Only parses the basic box structure
// (section 4.3). Only validates box size values. If an error occurs, `input`
// will not be modified. `allow_implicit_length` determines if LBox values
// of 0 are allowed. This value should be set to true only if the current
// parsing context would allow for an implicit box length.
absl::StatusOr<IntermediateBox> ConsumeBox(absl::string_view* input,
bool allow_implicit_length);
} // namespace jumbf_internal
#endif // THIRD_PARTY_CREDENTIO_JUMBF_INTERNAL_CONSUME_BOX_H_