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

int GIFFManager::get_chunks_number ( const GUTF8String name )

Will return the number of chunks with given name. The {name} may not end with brackets, but may contain them inside. It may also contain dots and colons. If {name} is ZERO, the total number of chunks will be returned.

{ Examples:} {verbatim} ;; To get the number of DJVU forms inside DjVm document m.getChunksNumber(".DJVM.DJVU"); ;; Same thing without top-level chunk name specification m.getChunksNumber("DJVU"); {verbatim}

Definition at line 566 of file GIFFManager.cpp.

References get_chunk(), get_chunks_number(), GBaseString::rsearch(), and GUTF8String::substr().

Referenced by get_chunks_number().

  DEBUG_MSG("GIFFManager::get_chunks_number(): name='" << name << "'\n");

  int retval;
  const int last_dot=name.rsearch('.');
  if (last_dot<0)
  }else if(!last_dot)
    retval=(top_level->get_name()==name.substr(1,(unsigned int)-1))?1:0;
    GP<GIFFChunk> chunk=get_chunk(name.substr(0,last_dot));
    retval=( chunk
      ?(chunk->get_chunks_number(name.substr(last_dot+1,(unsigned int)-1)))
      :0 );
  return retval;

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index