chromium/third_party/mediapipe/src/mediapipe/tasks/cc/metadata/utils/zip_readonly_mem_file.h

/* Copyright 2022 The MediaPipe Authors.

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

    http://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 MEDIAPIPE_TASKS_CC_METADATA_UTILS_ZIP_MEM_FILE_H_
#define MEDIAPIPE_TASKS_CC_METADATA_UTILS_ZIP_MEM_FILE_H_

#include <cstdlib>

#include "absl/strings/string_view.h"
#include "contrib/minizip/ioapi.h"

namespace mediapipe {
namespace tasks {
namespace metadata {

// In-memory read-only zip file implementation.
//
// Adapted from [1], with a few key differences:
// * backed by an `absl::string_view` instead of malloc-ed C buffers,
// * supports opening the file for reading through `unzOpen2_64`.
//
// This class is NOT thread-safe.
//
// [1]:
// https://github.com/google/libkml/blob/master/third_party/zlib-1.2.3/contrib/minizip/iomem_simple.c
class ZipReadOnlyMemFile {};

}  // namespace metadata
}  // namespace tasks
}  // namespace mediapipe

#endif  // MEDIAPIPE_TASKS_CC_METADATA_UTILS_ZIP_MEM_FILE_H_