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

int GIFFChunk::get_chunks_number ( const GUTF8String name  ) 

Returns the number of chunks with given {name}. The {name} may not contain dots and brackets. If {name} is ZERO, the total number of chunks will be returned.

Definition at line 309 of file GIFFManager.cpp.

References GBaseString::contains(), get_chunks_number(), and get_name().

Referenced by get_chunks_number().

{
  DEBUG_MSG("GIFFChunk::get_chunks_number(): Returning number of chunks '" << name <<
     "' in '" << get_name() << "'\n");
  DEBUG_MAKE_INDENT(3);

  if (name.contains("[]")>=0)
    G_THROW( ERR_MSG("GIFFManager.no_brackets") );
  
  int number; 
  GUTF8String short_name=decode_name(name,number);
   
  int num=0;
  for(GPosition pos=chunks;pos;++pos)
     num+=(chunks[pos]->get_name()==short_name);
  return num;
}


Generated by  Doxygen 1.6.0   Back to index