Logo Search packages:      
Sourcecode: djvulibre version File versions

void DjVuFile::change_meta ( const GUTF8String meta,
const bool  do_reset = false 
)

Changes the value of the metadata.

Definition at line 2811 of file DjVuFile.cpp.

References IFFByteStream::close_chunk(), contains_meta(), ByteStream::create(), IFFByteStream::get_bytestream(), get_meta(), GBaseString::length(), meta, IFFByteStream::put_chunk(), and reset().

{
  DEBUG_MSG("DjVuFile::change_meta()\n");
  // Mark this as modified
  set_modified(true);
  if(contains_meta())
  {
    (void)get_meta();
  }
  if(do_reset)
    reset();
  GCriticalSectionLock lock(&meta_lock);
  meta=ByteStream::create();
  if(xmeta.length())
  {
    const GP<IFFByteStream> giff=IFFByteStream::create(meta);
    IFFByteStream &iff=*giff;
    iff.put_chunk("METz");
    {
      GP<ByteStream> gbsiff=BSByteStream::create(iff.get_bytestream(),50);
      gbsiff->writestring(xmeta);
    }
    iff.close_chunk();
  }
}


Generated by  Doxygen 1.6.0   Back to index