DjVmDir::File Class Reference

Inheritance diagram for DjVmDir::File:

GPEnabled List of all members.

Detailed Description

Definition at line 223 of file DjVmDir.h.


Public Types

 INCLUDE = 0
 PAGE = 1
 THUMBNAILS = 2
 SHARED_ANNO = 3
enum  FILE_TYPE { INCLUDE = 0, PAGE = 1, THUMBNAILS = 2, SHARED_ANNO = 3 }

Public Member Functions

const GUTF8Stringcheck_save_name (const bool as_bundled)
const GUTF8Stringget_save_name (void) const
void set_load_name (const GUTF8String &id)
GUTF8String get_str_type (void) const
bool is_page (void) const
bool is_include (void) const
bool is_thumbnails (void) const
bool is_shared_anno (void) const
int get_page_num (void) const
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

Author:
Andrei Erofeev <eaf@geocities.com>
Version:
#
Id
DjVmDir.h,v 1.10 2003/11/07 22:08:20 leonb Exp
#


const GUTF8Stringget_load_name (void) const
const GUTF8Stringget_title () const
void set_title (const GUTF8String &id)

Static Public Member Functions

static GP< Filecreate (void)
static GP< Filecreate (const GUTF8String &load_name, const GUTF8String &save_name, const GUTF8String &title, const FILE_TYPE file_type)

Public Attributes

int offset
int size
bool valid_name

Protected Member Functions

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

Protected Attributes

GUTF8String name
GUTF8String oldname
GUTF8String id
GUTF8String title

Friends

class DjVmDir

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}

Definition at line 244 of file DjVmDir.h.


Constructor & Destructor Documentation

DjVmDir::File::File ( void   )  [protected]

Default constructor.

Definition at line 180 of file DjVmDir.cpp.


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.

const GUTF8String & DjVmDir::File::get_load_name ( void   )  const [inline]

File identifier.

The encoder assigns a unique identifier to each file in a multipage document. This is the name used when loading files. Indirection chunks in other files (#"INCL"# chunks) may refer to another file using its identifier.

Definition at line 339 of file DjVmDir.h.

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

Reports an ascii string indicating file type.

Definition at line 184 of file DjVmDir.cpp.

const GUTF8String & DjVmDir::File::get_title (  )  const [inline]

File title.

The file title is assigned by the user and may be used as a shortcut for viewing a particular page. Names like #"chapter1"# or #"appendix"# are appropriate.

Definition at line 343 of file DjVmDir.h.

bool DjVmDir::File::is_include ( void   )  const [inline]

Returns TRUE# if this file is included into some other files of this document.

Definition at line 306 of file DjVmDir.h.

bool DjVmDir::File::is_page ( void   )  const [inline]

Tests if this file represents a page of the document.

Definition at line 299 of file DjVmDir.h.

bool DjVmDir::File::is_shared_anno ( void   )  const [inline]

Returns the page number of this file.

This function returns #-1# if this file does not represent a page of the document.

Definition at line 319 of file DjVmDir.h.

bool DjVmDir::File::is_thumbnails ( void   )  const [inline]

Returns TRUE# if this file contains thumbnails for the document pages.

Definition at line 312 of file DjVmDir.h.


Member Data Documentation

Offset of the file data in a bundled DJVM file.

This number is relevant in the {bundled} case only when everything is packed into one single file.

Definition at line 287 of file DjVmDir.h.

Size of the file data in a bundled DJVM file.

This number is relevant in the {bundled} case only when everything is packed into one single file.

Definition at line 292 of file DjVmDir.h.

Have we checked the saved file name, to see if it is valid on the local disk?

Definition at line 296 of file DjVmDir.h.


The documentation for this class was generated from the following files:
KDE Home | KDE Accessibility Home | Description of Access Keys