Logo Search packages:      
Sourcecode: pwlib version File versions

PString PFilePath::GetFileName (  )  const

Get the actual directory entry name component of the full file specification. This may be identical to GetTitle() + GetType()# or simply GetTitle()# depending on the platform. eg for DOS file "C:\SRC\PWLIB\FRED.TXT" this would be "FRED.TXT".

Returns:
string for the file name part of the file specification.

Definition at line 706 of file ptlib.cxx.

References PString::FindLast(), PString::GetLength(), and PString::Mid().

Referenced by PURL::PURL(), PFTPServer::SendToClient(), and PRFC822Channel::SetContentAttachment().

{
  PINDEX backslash = FindLast('\\', GetLength()-2);
  if (backslash == P_MAX_INDEX)
    backslash = 0;
  else
    backslash++;

  return Mid(backslash);
}


Generated by  Doxygen 1.6.0   Back to index