blob: 584fc68e6beae8e4d954af93a552ba1d40d68894 [file]
# 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.
#
load("@rules_cc//cc:cc_library.bzl", "cc_library")
load("@rules_cc//cc:cc_test.bzl", "cc_test")
package(default_visibility = ["//visibility:public"])
cc_library(
name = "box_header",
srcs = ["box_header.cc"],
hdrs = ["box_header.h"],
deps = [
":constants",
":xpath",
"//constants:labels",
"//formats:byte_range",
"@abseil-cpp//absl/base:no_destructor",
"@abseil-cpp//absl/container:flat_hash_map",
"@abseil-cpp//absl/container:flat_hash_set",
"@abseil-cpp//absl/functional:function_ref",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/status:status_macros",
"@abseil-cpp//absl/status:statusor",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/strings:string_view",
"@riegeli//riegeli/bytes:reader",
"@riegeli//riegeli/bytes:writer",
"@riegeli//riegeli/endian:endian_reading",
"@riegeli//riegeli/endian:endian_writing",
],
)
cc_library(
name = "constants",
hdrs = ["constants.h"],
deps = ["@abseil-cpp//absl/strings:string_view"],
)
cc_library(
name = "xpath",
srcs = ["xpath.cc"],
hdrs = ["xpath.h"],
deps = ["@abseil-cpp//absl/strings"],
)
cc_library(
name = "test_utils",
testonly = 1,
hdrs = ["test_utils.h"],
deps = [
"//constants:labels",
"//testing:test_string_utils",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/strings:string_view",
],
)
cc_test(
name = "xpath_test",
srcs = ["xpath_test.cc"],
deps = [
":xpath",
"@googletest//:gtest_main",
],
)
cc_library(
name = "box_matcher",
srcs = ["box_matcher.cc"],
hdrs = ["box_matcher.h"],
deps = [
":box_header",
":xpath",
"//proto:bmff_based_hash_assertion_cc_proto",
"@abseil-cpp//absl/base:nullability",
"@abseil-cpp//absl/log:die_if_null",
"@riegeli//riegeli/bytes:reader",
],
)
cc_test(
name = "box_matcher_test",
srcs = ["box_matcher_test.cc"],
deps = [
":box_header",
":box_matcher",
":test_utils",
"//constants:labels",
"//proto:bmff_based_hash_assertion_cc_proto",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/strings:string_view",
"@googletest//:gtest_main",
"@riegeli//riegeli/bytes:string_reader",
],
)
cc_library(
name = "extractor",
srcs = ["extractor.cc"],
hdrs = ["extractor.h"],
deps = [
":box_header",
"//constants:labels",
"//formats:asset_byte_info",
"//formats:byte_range",
"//formats:extractor",
"//jumbf:utils",
"//utils:riegeli",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/status:status_macros",
"@abseil-cpp//absl/status:statusor",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/strings:string_view",
"@riegeli//riegeli/bytes:reader",
],
)
cc_test(
name = "extractor_test",
srcs = ["extractor_test.cc"],
deps = [
":extractor",
":test_utils",
"//constants:labels",
"//formats:asset_box",
"//formats:asset_byte_info",
"//formats:byte_range",
"//formats:extractor_result",
"//testing:jumbf_utils",
"//testing:test_string_utils",
"@abseil-cpp//absl/log:check",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/status:status_matchers",
"@abseil-cpp//absl/status:statusor",
"@abseil-cpp//absl/strings",
"@abseil-cpp//absl/strings:string_view",
"@googletest//:gtest_main",
"@riegeli//riegeli/bytes:string_reader",
],
)
cc_library(
name = "assessor",
srcs = ["assessor.cc"],
hdrs = ["assessor.h"],
deps = [
":box_header",
"//formats:assessor",
"@abseil-cpp//absl/status",
"@abseil-cpp//absl/status:status_macros",
"@abseil-cpp//absl/status:statusor",
"@abseil-cpp//absl/strings",
"@riegeli//riegeli/bytes:reader",
],
)
cc_test(
name = "assessor_test",
srcs = ["assessor_test.cc"],
deps = [
":assessor",
":test_utils",
"@abseil-cpp//absl/status:status_matchers",
"@abseil-cpp//absl/strings",
"@googletest//:gtest_main",
"@riegeli//riegeli/bytes:string_reader",
],
)
cc_library(
name = "format",
srcs = ["format.cc"],
hdrs = ["format.h"],
deps = [
":assessor",
":extractor",
"//formats:format",
"@abseil-cpp//absl/status:statusor",
],
)