Logo Search packages:      
Sourcecode: djvulibre version File versions  Download package

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 154 of file DjVmDir.h.

Public Types


Public Member Functions

const GUTF8Stringcheck_save_name (const bool as_bundled)
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
const GUTF8Stringget_load_name (void) const
int get_page_num (void) const
int get_page_pos (int page_num) const
int get_pages_num (void) const
const GUTF8Stringget_save_name (void) const
GP< File > get_shared_anno_file (void) const
GUTF8String get_str_type (void) const
const GUTF8Stringget_title () 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_include (void) const
bool is_indirect (void) const
bool is_page (void) const
bool is_shared_anno (void) const
bool is_thumbnails (void) const
GP< File > name_to_file (const GUTF8String &name) const
GP< File > page_to_file (int page_num) const
GP< File > pos_to_file (int fileno, int *ppageno=0) 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)
void set_load_name (const GUTF8String &id)
void set_title (const GUTF8String &id)
GP< File > title_to_file (const GUTF8String &title) const

Static Public Member Functions

static GP< File > create (const GUTF8String &load_name, const GUTF8String &save_name, const GUTF8String &title, const FILE_TYPE file_type)
static GP< File > create (void)
static GP< DjVmDircreate (void)

Public Attributes

int offset
int size
bool valid_name

Static Public Attributes

static const int version = 1

Protected Member Functions

 DjVmDir (void)
 File (void)
void set_save_name (const GUTF8String &name)

Protected Attributes

volatile int count
 The reference counter.
GUTF8String id
GUTF8String name
GUTF8String oldname
GUTF8String title

Private Types

enum  FLAGS_0 { IS_PAGE_0 = 1, HAS_NAME_0 = 2, HAS_TITLE_0 = 4 }
enum  FLAGS_1 { HAS_NAME = 0x80, HAS_TITLE = 0x40, TYPE_MASK = 0x3f }

Static Private Member Functions

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

Private Attributes

GCriticalSection class_lock
GPList< File > files_list
unsigned char flags
GPMap< GUTF8String, File > id2file
GPMap< GUTF8String, File > name2file
GPArray< File > page2file
int page_num
GPMap< GUTF8String, File > title2file


class DjVmDir

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

Generated by  Doxygen 1.6.0   Back to index