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

PFilePath PURL::AsFilePath (  ) const

Get the "file:" URL as a file path. If the URL is not a "file:" URL then returns an empty string.

Definition at line 937 of file http.cxx.

References PString::Empty(), and relativePath.

{
  //if (scheme != SchemeTable[FILE_SCHEME].name)
  //  return PString::Empty();
  if (scheme != FILE_SCHEME)
    return PString::Empty();

  PStringStream str;

  if (relativePath) {
    for (PINDEX i = 0; i < path.GetSize(); i++) {
      if (i > 0)
        str << PDIR_SEPARATOR;
      str << path[i];
    }
  }
  else {
    if (hostname != "localhost")
      str << PDIR_SEPARATOR << hostname;
    for (PINDEX i = 0; i < path.GetSize(); i++)
      str << PDIR_SEPARATOR << path[i];
  }

  return str;
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index