Logo Search packages:      
Sourcecode: djvulibre version File versions

DjVmDir Class Reference

#include <DjVmDir.h>

Inheritance diagram for DjVmDir:


List of all members.

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 delete_file (const GUTF8String &id)
void encode (const GP< ByteStream > &stream, const bool bundled, const bool do_rename) const
void encode (const GP< ByteStream > &stream, const bool do_rename=false) const
int get_count (void) const
int get_file_pos (const File *f) const
GPList< File > get_files_list (void) const
int get_files_num (void) const
int get_page_pos (int page_num) const
int get_pages_num (void) const
GP< File > get_shared_anno_file (void) const
GP< File > id_to_file (const GUTF8String &id) const
int insert_file (const GP< File > &file, int pos=-1)
bool is_bundled (void) const
bool is_indirect (void) const
GP< File > name_to_file (const GUTF8String &name) const
GP< File > page_to_file (int page_num) const
GPList< File > resolve_duplicates (const bool save_as_bundled)
void set_file_name (const GUTF8String &id, const GUTF8String &name)
void set_file_title (const GUTF8String &id, const GUTF8String &title)
GP< File > title_to_file (const GUTF8String &title) const

Static Public Member Functions

static GP< DjVmDircreate (void)

Static Public Attributes

static const int version = 1

Protected Member Functions

 DjVmDir (void)

Protected Attributes

volatile int count
 The reference counter.

Static Private Member Functions

static void decode (ByteStream *)
static void encode (ByteStream *)

Private Attributes

GCriticalSection class_lock
GPList< File > files_list
GPMap< GUTF8String, File > id2file
GPMap< GUTF8String, File > name2file
GPArray< File > page2file
GPMap< GUTF8String, File > title2file


class  File

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index