Dactyloidae/toolkit/mozapps/update/updater/archivereader.h
Moonchild a39fd9e75f Issue #1656 - Remove more vim control lines.
Vim control lines were re-introduced or not entirely cleaned up.
This nukes them again.
Removing from modules, netwerk, security, storage, testing, toolkit, and
a few scattered misc files. More to come.
2023-05-05 22:59:16 +08:00

40 lines
1 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef ArchiveReader_h__
#define ArchiveReader_h__
#include <stdio.h>
#include "mar.h"
#ifdef XP_WIN
typedef WCHAR NS_tchar;
#else
typedef char NS_tchar;
#endif
// This class provides an API to extract files from an update archive.
class ArchiveReader
{
public:
ArchiveReader() : mArchive(nullptr) {}
~ArchiveReader() { Close(); }
int Open(const NS_tchar *path);
int VerifySignature();
int VerifyProductInformation(const char *MARChannelID,
const char *appVersion);
void Close();
int ExtractFile(const char *item, const NS_tchar *destination);
int ExtractFileToStream(const char *item, FILE *fp);
private:
int ExtractItemToStream(const MarItem *item, FILE *fp);
MarFile *mArchive;
};
#endif // ArchiveReader_h__