Logo Search packages:      
Sourcecode: djvulibre version File versions

GPList< DjVuPort > DjVuPortcaster::prefix_to_ports ( const GUTF8String prefix  ) 

Returns a list of {DjVuPort}s with aliases starting with prefix#. If no {DjVuPort}s have been found, empty list is returned.

Definition at line 316 of file DjVuPort.cpp.

References GListTemplate< GP< TYPE >, GPBase >::append(), GBaseString::cmp(), is_port_alive(), and GBaseString::length().

Referenced by DjVuDocument::~DjVuDocument().

{
  GPList<DjVuPort> list;
  {
    int length=prefix.length();
    if (length)
    {
      GCriticalSectionLock lock(&map_lock);
      for(GPosition pos=a2p_map;pos;++pos)
        if (!prefix.cmp(a2p_map.key(pos), length))
        {
          DjVuPort * port=(DjVuPort *) a2p_map[pos];
          GP<DjVuPort> gp_port=is_port_alive(port);
          if (gp_port) list.append(gp_port);
        }
    }
  }
  return list;
}


Generated by  Doxygen 1.6.0   Back to index