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

PDirectory PFilePath::GetDirectory (  ) const

Get the the directory that the file is contained in. This may be identical to GetVolume() + GetPath()# depending on the platform. eg for DOS file "C:\SRC\PWLIB\FRED.TXT" this would be "C:\SRC\PWLIB\".

Note that for Unix platforms, this returns the { physical} path of the directory. That is all symlinks are resolved. Thus the directory returned may not be the same as the value of GetPath()#.

Returns:
Directory that the file is contained in.

Definition at line 690 of file ptlib.cxx.

References PString::FindLast(), and PString::Left().

Referenced by Xmlrpcsrvr::OnStart(), PURL::PURL(), and PFile::Rename().

{
  PINDEX backslash = FindLast('\\');
  if (backslash != P_MAX_INDEX)
    return Left(backslash+1);

  return PCaselessString();
}

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