#include "mediapipe/tasks/cc/metadata/utils/zip_utils.h"
#include <string>
#include "absl/cleanup/cleanup.h"
#include "absl/container/flat_hash_map.h"
#include "absl/log/absl_log.h"
#include "absl/status/status.h"
#include "absl/status/statusor.h"
#include "contrib/minizip/ioapi.h"
#include "contrib/minizip/unzip.h"
#include "mediapipe/framework/port/status_macros.h"
#include "mediapipe/tasks/cc/common.h"
#include "mediapipe/tasks/cc/metadata/utils/zip_readonly_mem_file.h"
namespace mediapipe {
namespace tasks {
namespace metadata {
namespace {
StatusCode;
absl::Status UnzipErrorToStatus(int error) { … }
struct ZipFileInfo { … };
absl::StatusOr<ZipFileInfo> GetCurrentZipFileInfo(const unzFile& zf) { … }
}
absl::Status ExtractFilesfromZipFile(
const char* buffer_data, const size_t buffer_size,
absl::flat_hash_map<std::string, absl::string_view>* files) { … }
void SetExternalFile(const absl::string_view& file_content,
core::proto::ExternalFile* model_file, bool is_copy) { … }
}
}
}