kviewshell
DjVuNavDir Class Reference
DjVu Navigation Directory. More...
#include <DjVuNavDir.h>
Public Member Functions | |
void | decode (ByteStream &str) |
void | delete_page (int page_num) |
void | encode (ByteStream &str) |
int | get_memory_usage (void) const |
int | get_pages_num (void) const |
void | insert_page (int where, const char *name) |
int | name_to_page (const char *name) const |
GUTF8String | page_to_name (int page) const |
GURL | page_to_url (int page) const |
int | url_to_page (const GURL &url) const |
virtual | ~DjVuNavDir (void) |
Static Public Member Functions | |
static GP< DjVuNavDir > | create (ByteStream &str, const GURL &dir_url) |
static GP< DjVuNavDir > | create (const GURL &dir_url) |
Protected Member Functions | |
DjVuNavDir (ByteStream &str, const GURL &dir_url) | |
DjVuNavDir (const GURL &dir_url) |
Detailed Description
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.
Definition at line 118 of file DjVuNavDir.h.
Constructor & Destructor Documentation
DjVuNavDir::DjVuNavDir | ( | const GURL & | dir_url | ) | [protected] |
Definition at line 83 of file DjVuNavDir.cpp.
DjVuNavDir::DjVuNavDir | ( | ByteStream & | str, | |
const GURL & | dir_url | |||
) | [protected] |
Definition at line 89 of file DjVuNavDir.cpp.
virtual DjVuNavDir::~DjVuNavDir | ( | void | ) | [inline, virtual] |
Definition at line 146 of file DjVuNavDir.h.
Member Function Documentation
static GP<DjVuNavDir> DjVuNavDir::create | ( | ByteStream & | str, | |
const GURL & | dir_url | |||
) | [inline, static] |
Creates DjVuNavDir# object by decoding its contents from the stream.
dir_url# is the URL of the file containing the directory source data.
Definition at line 143 of file DjVuNavDir.h.
static GP<DjVuNavDir> DjVuNavDir::create | ( | const GURL & | dir_url | ) | [inline, static] |
Creates a 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}()
Definition at line 137 of file DjVuNavDir.h.
void DjVuNavDir::decode | ( | ByteStream & | str | ) |
Decodes the directory contents from the given {ByteStream}.
Definition at line 99 of file DjVuNavDir.cpp.
void DjVuNavDir::delete_page | ( | int | page_num | ) |
Deletes page with number page_num# from the directory.
Definition at line 215 of file DjVuNavDir.cpp.
void DjVuNavDir::encode | ( | ByteStream & | str | ) |
Encodes the directory contents into the given {ByteStream}.
Definition at line 138 of file DjVuNavDir.cpp.
int DjVuNavDir::get_memory_usage | ( | void | ) | const [inline] |
Definition at line 131 of file DjVuNavDir.h.
int DjVuNavDir::get_pages_num | ( | void | ) | const |
void DjVuNavDir::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.
Definition at line 198 of file DjVuNavDir.cpp.
int DjVuNavDir::name_to_page | ( | const char * | name | ) | const |
Converts file name name# to page number.
Returns #-1# if file with given name cannot be found.
Definition at line 160 of file DjVuNavDir.cpp.
GUTF8String DjVuNavDir::page_to_name | ( | int | page | ) | const |
Converts given page# to URL.
Throws an exception if page number is invalid.
Definition at line 178 of file DjVuNavDir.cpp.
GURL DjVuNavDir::page_to_url | ( | int | page | ) | const |
Converts given page# to URL.
Throws an exception if page number is invalid.
Definition at line 190 of file DjVuNavDir.cpp.
int DjVuNavDir::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.
Definition at line 169 of file DjVuNavDir.cpp.
The documentation for this class was generated from the following files: