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

void GIFFChunk::set_name ( GUTF8String  name )

Sets the chunk name. The {name} may not contain dots or brackets, but { may} contain colons.

Definition at line 99 of file GIFFManager.cpp.

References GBaseString::contains(), GBaseString::search(), and GUTF8String::substr().

{
  DEBUG_MSG("GIFFChunk::set_name(): name='" << name << "'\n");
  DEBUG_MAKE_INDENT(3);

  const int colon=name.search(':');
  if(colon>=0)
  {
    type=name.substr(0,colon);
    name=name.substr(colon+1,(unsigned int)-1);
    if(name.search(':')>=0)
      G_THROW( ERR_MSG("GIFFManager.one_colon") );
  }

  DEBUG_MSG("auto-setting type to '" << type << "'\n");

  if (name.contains(".[]")>=0)
    G_THROW( ERR_MSG("GIFFManager.bad_char") );

  strncpy(GIFFChunk::name, (const char *)name, 4);
  GIFFChunk::name[4]=0;
  for(int i=strlen(GIFFChunk::name);i<4;i++)
    GIFFChunk::name[i]=' ';
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index