File: MultiArchive.rst

package info (click to toggle)
mupdf 1.27.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,224 kB
  • sloc: ansic: 335,320; python: 20,906; java: 7,520; javascript: 2,213; makefile: 1,152; xml: 675; cpp: 639; sh: 513; cs: 307; awk: 10; sed: 7; lisp: 3
file content (44 lines) | stat: -rw-r--r-- 1,197 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
.. default-domain:: js

.. highlight:: javascript

MultiArchive
============

|only_mutool|

Constructors
------------

.. class:: MultiArchive()

	Create a new empty multi archive.

	.. code-block::

		var multiArchive = new mupdf.MultiArchive()

Instance methods
----------------

.. method:: MultiArchive.prototype.mountArchive(subArchive, path)

	Add an archive to the set of archives handled by a multi archive.
	If ``path`` is ``null``, the ``subArchive`` contents appear at the
	top-level, otherwise they will appear prefixed by the string
	``path``.

	:param Archive subArchive: An archive that will be a child archive of this one.
	:param string path: The path at which the archive will be inserted.

	In the following example ``example1.zip`` contains ``file1.txt`` and
	``example2.zip`` contains ``file2.txt``. The MultiArchive now lets you
	access both ``file1.txt`` and ``subpath/file2.txt``:

	.. code-block::

		var archive = new mupdf.MultiArchive()
		archive.mountArchive(new mupdf.Archive("example1.zip"), null)
		archive.mountArchive(new mupdf.Archive("example2.zip"), "subpath")
		console.log(archive.hasEntry("file1.txt"))
		console.log(archive.hasEntry("subpath/file2.txt"))