kviewshell
DjVmDir::File Class Reference
#include <DjVmDir.h>
Public Types | |
enum | FILE_TYPE { INCLUDE = 0, PAGE = 1, THUMBNAILS = 2, SHARED_ANNO = 3 } |
Public Member Functions | |
const GUTF8String & | check_save_name (const bool as_bundled) |
int | get_page_num (void) const |
const GUTF8String & | get_save_name (void) const |
GUTF8String | get_str_type (void) const |
bool | is_include (void) const |
bool | is_page (void) const |
bool | is_shared_anno (void) const |
bool | is_thumbnails (void) const |
void | set_load_name (const GUTF8String &id) |
DjVmDir.h | |
Files #"DjVmDir.h"# and #"DjVmDir.cpp"# implement class {DjVmDir} for representing the directory of a DjVu multipage document. { Bundled vs. Indirect format} --- 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. { Multipage DjVu format} --- Multipage DjVu documents follow the EA IFF85 format (cf. {IFFByteStream.h}.) A document is composed of a #"FORM:DJVM"# whose first chunk is a #"DIRM"# chunk containing the {document directory}. This directory lists all component files composing the given document, helps to access every component file and identify the pages of the document. {itemize} In a {bundled} multipage file, the component files are stored immediately after the #"DIRM"# chunk, within the #"FORM:DJVU"# composite chunk. In an {indirect} multipage file, the component files are stored in different files whose URLs are composed using information stored in the #"DIRM"# chunk. {itemize} Most of the component files represent pages of a document. Some files however represent data shared by several pages. The pages refer to these supporting files by means of an inclusion chunk (#"INCL"# chunks) identifying the supporting file. { Document Directory} --- Every directory record describes a component file. Each component file is identified by a small string named the identifier (ID). Each component file also contains a file name and a title. The format of the #"DIRM"# chunk is described in section {Format of the DIRM chunk.}. Theoretically, IDs are used to uniquely identify each component file in #"INCL"# chunks, names are used to compose the the URLs of the component files in an indirect multipage DjVu file, and titles are cosmetic names possibly displayed when viewing a page of a document. There are however many problems with this scheme, and we {strongly suggest}, with the current implementation to always make the file ID, the file name and the file title identical. Implements DjVu multipage document directory
| |
const GUTF8String & | get_load_name (void) const |
const GUTF8String & | get_title () const |
void | set_title (const GUTF8String &id) |
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) |
Public Attributes | |
int | offset |
int | size |
bool | valid_name |
Protected Member Functions | |
File (void) | |
void | set_save_name (const GUTF8String &name) |
Protected Attributes | |
GUTF8String | id |
GUTF8String | name |
GUTF8String | oldname |
GUTF8String | title |
Detailed Description
Definition at line 223 of file DjVmDir.h.
Member Enumeration Documentation
File type.
Possible file types are: {description} [PAGE] This is a top level page file. It may include other INCLUDE::d files, which may in turn be shared between different pages. [INCLUDE] This file is included into some other file inside this document. [THUMBNAILS] This file contains thumbnails for the document pages. [SHARED_ANNO] This file contains annotations shared by all the pages. It's supposed to be included into every page for the annotations to take effect. There may be only one file with shared annotations in a document. {description}
Constructor & Destructor Documentation
DjVmDir::File::File | ( | void | ) | [protected] |
Member Function Documentation
const GUTF8String & DjVmDir::File::check_save_name | ( | const bool | as_bundled | ) |
Check for filenames that are not valid for the native encoding, and change them.
Definition at line 95 of file DjVmDir.cpp.
GP< DjVmDir::File > DjVmDir::File::create | ( | const GUTF8String & | load_name, | |
const GUTF8String & | save_name, | |||
const GUTF8String & | title, | |||
const FILE_TYPE | file_type | |||
) | [static] |
Definition at line 81 of file DjVmDir.cpp.
const GUTF8String & DjVmDir::File::get_load_name | ( | void | ) | const [inline] |
const GUTF8String & DjVmDir::File::get_save_name | ( | void | ) | const |
File name.
The optional file name must be unique and is the name that will be used when the document is saved to an indirect file. If not assigned, the value of id# will be used for this purpose. By keeping the name in {bundled} document we guarantee, that it can be expanded later into {indirect} document and files will still have the same names, if the name is legal on a given filesystem.
Definition at line 135 of file DjVmDir.cpp.
GUTF8String DjVmDir::File::get_str_type | ( | void | ) | const |
const GUTF8String & DjVmDir::File::get_title | ( | ) | const [inline] |
bool DjVmDir::File::is_include | ( | void | ) | const [inline] |
bool DjVmDir::File::is_page | ( | void | ) | const [inline] |
bool DjVmDir::File::is_shared_anno | ( | void | ) | const [inline] |
bool DjVmDir::File::is_thumbnails | ( | void | ) | const [inline] |
void DjVmDir::File::set_load_name | ( | const GUTF8String & | id | ) |
Definition at line 141 of file DjVmDir.cpp.
void DjVmDir::File::set_save_name | ( | const GUTF8String & | name | ) | [protected] |
Definition at line 152 of file DjVmDir.cpp.
void DjVmDir::File::set_title | ( | const GUTF8String & | id | ) | [inline] |
Member Data Documentation
GUTF8String DjVmDir::File::id [protected] |
GUTF8String DjVmDir::File::name [protected] |
GUTF8String DjVmDir::File::oldname [protected] |
GUTF8String DjVmDir::File::title [protected] |
The documentation for this class was generated from the following files: