File: TreeArchive.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 (37 lines) | stat: -rw-r--r-- 713 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
.. default-domain:: js

.. highlight:: javascript

TreeArchive
===========

|only_mutool|

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

.. class:: TreeArchive()

	Create a new empty tree archive.

	.. code-block::

		var treeArchive = new mupdf.TreeArchive()

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

.. method:: TreeArchive.prototype.add(name, buffer)

	Add a named buffer to a tree archive.

	:param string name: Name of archive entry to add.
	:param Buffer | ArrayBuffer | Uint8Array | string buffer: Buffer of data to store with the entry.

	.. code-block::

		var buf = new mupdf.Buffer()
		buf.writeLine("hello world!")
		var archive = new mupdf.TreeArchive()
		archive.add("file2.txt", buf)
		print(archive.hasEntry("file2.txt"))