LibreOffice Module onlineupdate (master) 1
archivereader.h
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* vim:set ts=2 sw=2 sts=2 et cindent: */
3/* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7#ifndef ArchiveReader_h__
8#define ArchiveReader_h__
9
10#include <stdio.h>
11#include <onlineupdate/mar.h>
12#include "types.hxx"
13
14// This class provides an API to extract files from an update archive.
16{
17public:
18 ArchiveReader() : mArchive(nullptr) {}
20 {
21 Close();
22 }
23
24 int Open(const NS_tchar *path);
25 int VerifySignature();
26 int VerifyProductInformation(const char *MARChannelID,
27 const char *appVersion);
28 void Close();
29
30 int ExtractFile(const char *item, const NS_tchar *destination);
31 int ExtractFileToStream(const char *item, FILE *fp);
32
33private:
34 int ExtractItemToStream(const MarItem *item, FILE *fp);
35
37};
38
39#endif // ArchiveReader_h__
MarFile * mArchive
Definition: archivereader.h:36
int Open(const NS_tchar *path)
int ExtractFile(const char *item, const NS_tchar *destination)
int VerifySignature()
Performs a verification on the opened MAR file.
int ExtractItemToStream(const MarItem *item, FILE *fp)
int ExtractFileToStream(const char *item, FILE *fp)
int VerifyProductInformation(const char *MARChannelID, const char *appVersion)
Verifies that the MAR file matches the current product, channel, and version.
Definition: mar.h:48
The MAR item data structure.
Definition: mar.h:38
char NS_tchar
Definition: types.hxx:20