Logo Search packages:      
Sourcecode: djvulibre version File versions  Download package

void GIFFChunk::add_chunk ( const GP< GIFFChunk > &  chunk,
int  order = -1 
)

Adds the {chunk} to the chunks list at position {order}. Set {order} to #-1# to append the chunk to the list. { Note!} By adding chunk PROP# you will convert this chunk to type LIST# {automatically}.

Definition at line 177 of file GIFFManager.cpp.

References GListTemplate< TYPE, TI >::append(), get_name(), GListTemplate< TYPE, TI >::insert_before(), GBaseString::length(), and GListTemplate< TYPE, TI >::nth().

{
  DEBUG_MSG("GIFFChunk::add_chunk(): Adding chunk to '" << get_name() <<
     "' @ position=" << position << "\n");
  DEBUG_MAKE_INDENT(3);

  if (!type.length())
  {
    DEBUG_MSG("Converting the parent to FORM\n");
    type="FORM";
  }

  if (chunk->get_type()=="PROP")
  {
    DEBUG_MSG("Converting the parent to LIST\n");
    type="LIST";
  }

  GPosition pos;
  if (position>=0 && chunks.nth(position, pos))
  {
    chunks.insert_before(pos, chunk);
  }else
  {
    chunks.append(chunk);
  }
}


Generated by  Doxygen 1.6.0   Back to index