DjVmDir Class Reference
#include <DjVmDir.h>
Inheritance diagram for DjVmDir:

Detailed Description
Implements DjVu multipage document directory.There are currently two multipage DjVu formats supported: {bundled} and {indirect}. In the first format all component files composing a given document are packaged (or bundled) into one file, in the second one every page and component is stored in a separate file and there is one more file, which contains the list of all others.
The multipage document directory lists all component files composing the given document, helps to access every file, identify pages and maintain user-specified shortcuts. Every directory record describes a file composing the document. Each file is identified by a small string named the identifier (ID). Each file may also contain a file name and a title.
The DjVmDir# class represents a multipage document directory. Its main purpose is to encode and decode the document directory when writing or reading the DIRM# chunk. Normally you don't have to create this class yourself. It's done automatically when DjVmDoc} class initializes itself. It may be useful though to be able to access records in the directory because some classes (like DjVuDocument} and DjVmDoc}) return a pointer to DjVmDir# in some cases.
Definition at line 152 of file DjVmDir.h.
Public Member Functions | |
| void | decode (const GP< ByteStream > &stream) |
| void | encode (const GP< ByteStream > &stream, const bool do_rename=false) const |
| void | encode (const GP< ByteStream > &stream, const bool bundled, const bool do_rename) const |
| bool | is_indirect (void) const |
| bool | is_bundled (void) const |
| GP< File > | page_to_file (int page_num) const |
| GP< File > | name_to_file (const GUTF8String &name) const |
| GP< File > | id_to_file (const GUTF8String &id) const |
| GP< File > | title_to_file (const GUTF8String &title) const |
| int | get_file_pos (const File *f) const |
| int | get_page_pos (int page_num) const |
| GPList< File > | resolve_duplicates (const bool save_as_bundled) |
| GPList< File > | get_files_list (void) const |
| int | get_files_num (void) const |
| int | get_pages_num (void) const |
| GP< File > | get_shared_anno_file (void) const |
| void | set_file_title (const GUTF8String &id, const GUTF8String &title) |
| void | set_file_name (const GUTF8String &id, const GUTF8String &name) |
| int | insert_file (const GP< File > &file, int pos=-1) |
| void | delete_file (const GUTF8String &id) |
Static Public Member Functions | |
| static GP< DjVmDir > | create (void) |
Static Public Attributes | |
| static const int | version = 1 |
Protected Member Functions | |
| DjVmDir (void) | |
Classes | |
| class | File |
Constructor & Destructor Documentation
| DjVmDir::DjVmDir | ( | void | ) | [inline, protected] |
Class DjVmDir::File} represents the directory records managed by class DjVmDir}.
Member Function Documentation
Class DjVmDir::File} represents the directory records managed by class DjVmDir}.
| void DjVmDir::decode | ( | const GP< ByteStream > & | stream | ) |
| void DjVmDir::delete_file | ( | const GUTF8String & | id | ) |
| void DjVmDir::encode | ( | const GP< ByteStream > & | stream, | |
| const bool | bundled, | |||
| const bool | do_rename | |||
| ) | const |
Encodes the directory into the specified stream, explicitely as bundled or indirect.
Definition at line 411 of file DjVmDir.cpp.
| void DjVmDir::encode | ( | const GP< ByteStream > & | stream, | |
| const bool | do_rename = false | |||
| ) | const |
| int DjVmDir::get_file_pos | ( | const File * | f | ) | const |
| GPList< DjVmDir::File > DjVmDir::get_files_list | ( | void | ) | const |
| int DjVmDir::get_files_num | ( | void | ) | const |
| int DjVmDir::get_page_pos | ( | int | page_num | ) | const |
| int DjVmDir::get_pages_num | ( | void | ) | const |
| GP< DjVmDir::File > DjVmDir::get_shared_anno_file | ( | void | ) | const |
Returns back pointer to the file with SHARED_ANNO# flag.
Note that there may be only one file with shared annotations in any multipage DjVu document.
Definition at line 608 of file DjVmDir.cpp.
| GP< DjVmDir::File > DjVmDir::id_to_file | ( | const GUTF8String & | id | ) | const |
Inserts the specified file record at the specified position.
Specifying pos# equal to #-1# means to append. The actual position inserted is returned.
Definition at line 626 of file DjVmDir.cpp.
| bool DjVmDir::is_bundled | ( | void | ) | const [inline] |
| bool DjVmDir::is_indirect | ( | void | ) | const [inline] |
| GP< DjVmDir::File > DjVmDir::name_to_file | ( | const GUTF8String & | name | ) | const |
| GP< DjVmDir::File > DjVmDir::page_to_file | ( | int | page_num | ) | const |
| GPList< DjVmDir::File > DjVmDir::resolve_duplicates | ( | const bool | save_as_bundled | ) |
| void DjVmDir::set_file_name | ( | const GUTF8String & | id, | |
| const GUTF8String & | name | |||
| ) |
| void DjVmDir::set_file_title | ( | const GUTF8String & | id, | |
| const GUTF8String & | title | |||
| ) |
| GP< DjVmDir::File > DjVmDir::title_to_file | ( | const GUTF8String & | title | ) | const |
The documentation for this class was generated from the following files:

