Logo Search packages:      
Sourcecode: pwlib version File versions

PString PFilePath::GetTitle (  )  const

Get the title component of the full file specification, eg for the DOS file "C:\SRC\PWLIB\FRED.DAT" this would be "FRED".

string for the title part of the file specification.

Definition at line 718 of file ptlib.cxx.

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

Referenced by PProcess::PProcess().

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

  PINDEX last_dot = FindLast('.');
  if (last_dot < backslash)
    last_dot = P_MAX_INDEX;

  return operator()(backslash, last_dot-1);

Generated by  Doxygen 1.6.0   Back to index