LibreOffice Module shell (master) 1
zipfile.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#ifndef INCLUDED_SHELL_INC_INTERNAL_ZIPFILE_HXX
21#define INCLUDED_SHELL_INC_INTERNAL_ZIPFILE_HXX
22
23#include <string>
24#include <vector>
25#include <memory>
26#include "filepath.hxx"
27
28class StreamInterface;
29
33class ZipFile
34{
35public:
36 typedef std::vector<std::string> Directory_t;
37 typedef std::unique_ptr<Directory_t> DirectoryPtr_t;
38 typedef std::vector<char> ZipContentBuffer_t;
39
40public:
54 static bool IsZipFile(const Filepath_t& FileName);
55
56 static bool IsZipFile(void* stream);
57
73 static bool IsValidZipFileVersionNumber(const Filepath_t& FileName);
74
75 static bool IsValidZipFileVersionNumber(void* stream);
76
77public:
90 ZipFile(const Filepath_t& FileName);
91
92 ZipFile(StreamInterface* stream);
93
96 ~ZipFile();
97
116 void GetUncompressedContent(const std::string& ContentName,
117 /*inout*/ ZipContentBuffer_t& ContentBuffer);
118
123 DirectoryPtr_t GetDirectory() const;
124
129 bool HasContent(const std::string& ContentName) const;
130
131private:
132 StreamInterface* m_pStream;
133 bool m_bShouldFree;
134};
135
136#endif
137
138/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
~ZipFile()
Definition: zipfile.cxx:436
ZipFile(rtl::Reference< comphelper::RefCountedMutex > aMutexHolder, css::uno::Reference< css::io::XInputStream > const &xInput, css::uno::Reference< css::uno::XComponentContext > xContext, bool bInitialise)
std::string Filepath_t
Definition: filepath.hxx:22