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

GUTF8String GURL::name ( void   )  const

Returns the name part of this URL. For example, if the URL is http://www.lizardtech.com/file201.djvu# then this function will return file201.djvu#. {fname}() will return file 1.djvu# at the same time.

Definition at line 980 of file GURL.cpp.

References is_empty(), GBaseString::length(), and protocol().

Referenced by DataPool::connect(), extension(), and fname().

     const_cast<GURL *>(this)->init();
   GUTF8String retval;
     const GUTF8String xurl(url);
     const int protocol_length=protocol(xurl).length();
     const char * ptr, * xslash=(const char *)xurl+protocol_length-1;
     for(ptr=(const char *)xurl+protocol_length;
       *ptr && !is_argument(ptr);ptr++)
       if (*ptr==slash)
     retval=GUTF8String(xslash+1, ptr-xslash-1);
   return retval;

Generated by  Doxygen 1.6.0   Back to index