Logo Search packages:      
Sourcecode: djvulibre version File versions

void DjVmDoc::insert_file ( const GP< DjVmDir::File > &  f,
GP< DataPool data,
int  pos = -1 
)

Inserts a file described by {DjVmDir::File} structure with data data# at position pos#. If pos# is negative, the file will be appended to the document. Otherwise it will be inserted at position pos#.

Definition at line 170 of file DjVmDoc.cpp.

References GMapTemplate< KTYPE, VTYPE, TI >::contains(), DataPool::create(), and DjVmDir::insert_file().

{
   DEBUG_MSG("DjVmDoc::insert_file(): inserting file '" << f->get_load_name() <<
           "' at pos " << pos << "\n");
   DEBUG_MAKE_INDENT(3);

   if (!f)
     G_THROW( ERR_MSG("DjVmDoc.no_zero_file") );
   if (data.contains(f->get_load_name()))
     G_THROW( ERR_MSG("DjVmDoc.no_duplicate") );

   char buffer[4];
   if (data_pool->get_data(buffer, 0, 4)==4 && !memcmp(buffer, octets, 4))
   {
      data_pool=DataPool::create(data_pool, 4, -1);
   } 
   data[f->get_load_name()]=data_pool;
   dir->insert_file(f, pos);
}


Generated by  Doxygen 1.6.0   Back to index