Logo Search packages:      
Sourcecode: djvulibre version File versions

void DjVuFile::init ( const GP< ByteStream > &  str  ) 

Initializes a DjVuFile# object. This is a simplified initializer, which is not supposed to be used for decoding or creating DjVuFile::s, which include other files.

If the file is stored on the hard drive, you may also use the other constructor and pass it the file's URL and ZERO# port#. The DjVuFile# will read the data itself.

If you want to receive error messages and notifications, you may connect the DjVuFile# to your own {DjVuPort} after it has been constructed.

str The stream containing data for the file.

Definition at line 179 of file DjVuFile.cpp.

References DataPool::create(), file_size, GUTF8String::format(), and GPEnabled::get_count().

Referenced by create().

  DEBUG_MSG("DjVuFile::DjVuFile(): ByteStream constructor\n");
  if (initialized)
    G_THROW( ERR_MSG("DjVuFile.2nd_init") );
  if (!get_count())
    G_THROW( ERR_MSG("DjVuFile.not_secured") );
  // Read the data from the stream
  // Construct some dummy URL
  GUTF8String buffer;
  buffer.format("djvufile:/%p.djvu", this);
  DEBUG_MSG("DjVuFile::DjVuFile(): url is "<<(const char *)buffer<<"\n");
  // Set it here because trigger will call other DjVuFile's functions
  // Add (basically - call) the trigger
  data_pool->add_trigger(-1, static_trigger_cb, this);

Generated by  Doxygen 1.6.0   Back to index