Logo Search packages:      
Sourcecode: djvulibre version File versions

void DjVmDoc::expand ( const GURL codebase,
const GUTF8String idx_name 
)

Writes the multipage DjVu document in the {indirect} format into the given directory. Every page and included file will be stored as a separate file. Besides, one top-level file with the document directory (named idx_name#) will be created unless idx_name# is empty.

Parameters:
dir_name Name of the directory where files should be created
idx_name Name of the top-level file with the {DjVmDir} with the list of files composing the given document. If empty, the file will not be created.

Definition at line 603 of file DjVmDoc.cpp.

References ByteStream::create(), GBaseString::length(), DataPool::load_file(), DjVmDir::resolve_duplicates(), save_file(), and write_index().

{
   DEBUG_MSG("DjVmDoc::expand(): Expanding into '" << codebase << "'\n");
   DEBUG_MAKE_INDENT(3);

   // Resolve any name conflicts
   // Find the list of all files.
   GPList<DjVmDir::File> files_list=dir->resolve_duplicates(false);

      // store each file
   for(GPosition pos=files_list;pos;++pos)
   {
     save_file(codebase,*files_list[pos]);
   }

   if (idx_name.length())
   {
      const GURL::UTF8 idx_url(idx_name, codebase);
   
      DEBUG_MSG("storing index file '" << idx_url << "'\n");

      DataPool::load_file(idx_url);
      GP<ByteStream> str=ByteStream::create(idx_url, "wb");
      write_index(str);
   }
}


Generated by  Doxygen 1.6.0   Back to index