class DjVuNavDir: public GPEnabled

DjVu Navigation Directory.

Inheritance:


Public Methods

[more] DjVuNavDir(const char * dir_url)
Constructs DjVuNavDir object.
[more] DjVuNavDir(ByteStream & str, const char * dir_url)
Constructs DjVuNavDir object by decoding its contents from the stream.
[more]void decode(ByteStream & str)
Decodes the directory contents from the given ByteStream
[more]void encode(ByteStream & str)
Encodes the directory contents into the given ByteStream
[more]void insert_page(int where, const char * name)
Inserts a new page at position where pointing to a file with name name.
[more]void delete_page(int page_num)
Deletes page with number page_num from the directory.
[more]int get_pages_num(void) const
Returns the number of pages in the directory.
[more]int url_to_page(const GURL & url) const
Converts the url to page number.
[more]int name_to_page(const char * name) const
Converts file name name to page number.
[more]GURL page_to_url(int page) const
Converts given page to URL.
[more]GString page_to_name(int page) const
Converts given page to URL.


Inherited from GPEnabled:

Public Methods

oGPEnabled& operator=(const GPEnabled & obj)
oint get_count(void) const

Protected Fields

ovolatile int count


Documentation

DjVu Navigation Directory.

This class implements the navigation directory of a multipage DjVu document - basically a list of pages that this document is composed of. We would like to emphasize, that this is the list of namely pages, not files. Any page may include any number of additional files. When you've got an all-in-one-file multipage DjVu document (DjVm archive) you may get the files list from DjVmDir0 class.

The DjVuNavDir class can decode and encode the navigation directory from NDIR IFF chunk. It's normally created by the library during decoding procedure and can be accessed like any other component of the DjVuImage being decoded.

In a typical multipage DjVu document the navigation directory is stored in a separate IFF file containing only one chunk: NDIR chunk. This file should be included (by means of the INCL chunk) into every page of the document to enable the navigation.

o DjVuNavDir(const char * dir_url)
Constructs DjVuNavDir object. dir_url is the URL of the file containing the directory source data. It will be used later in translation by functions like url_to_page() and page_to_url()

o DjVuNavDir(ByteStream & str, const char * dir_url)
Constructs DjVuNavDir object by decoding its contents from the stream. dir_url is the URL of the file containing the directory source data.

ovoid decode(ByteStream & str)
Decodes the directory contents from the given ByteStream

ovoid encode(ByteStream & str)
Encodes the directory contents into the given ByteStream

ovoid insert_page(int where, const char * name)
Inserts a new page at position where pointing to a file with name name.

Parameters:
where - The position where the page should be inserted. -1 means to append.
name - The name of the file corresponding to this page. The name may not contain slashes. The file may include other files.

ovoid delete_page(int page_num)
Deletes page with number page_num from the directory.

oint get_pages_num(void) const
Returns the number of pages in the directory.

oint url_to_page(const GURL & url) const
Converts the url to page number. Returns -1 if the url does not correspond to anything in the directory.

oint name_to_page(const char * name) const
Converts file name name to page number. Returns -1 if file with given name cannot be found.

oGURL page_to_url(int page) const
Converts given page to URL. Throws an exception if page number is invalid.

oGString page_to_name(int page) const
Converts given page to URL. Throws an exception if page number is invalid.


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java


DjVu is a trademark of LizardTech, Inc.
All other products mentioned are registered trademarks or trademarks of their respective companies.