1
/* This file is (c) 2008-2011 Konstantin Isakov <ikm@goldendict.org>
2
* Part of GoldenDict. Licensed under GPLv3 or later, see the LICENSE file */
4
#ifndef __INDEXEDZIP_HH_INCLUDED__
5
#define __INDEXEDZIP_HH_INCLUDED__
10
/// Allows using a btree index to read zip files. Basically built on top of
11
/// the base dictionary infrastructure adapted for zips.
12
class IndexedZip: public BtreeIndexing::BtreeIndex
19
IndexedZip(): zipIsOpen( false )
22
/// Opens the index. The values are those previously returned by buildIndex().
23
using BtreeIndexing::BtreeIndex::openIndex;
25
/// Opens the zip file itself. Returns true if succeeded, false otherwise.
26
bool openZipFile( QString const & );
28
/// Returns true if the zip is open, false otherwise.
32
/// Checks whether the given file exists in the zip file or not.
33
/// Note that this function is thread-safe, since it does not access zip file.
34
bool hasFile( gd::wstring const & name );
36
/// Attempts loading the given file into the given vector. Returns true on
37
/// success, false otherwise.
38
bool loadFile( gd::wstring const & name, std::vector< char > & );