Logo Search packages:      
Sourcecode: pwlib version File versions

PString PFilePath::GetType (  )  const

Get the file type of the file. Note that on some platforms this may actually be part of the full name string. eg for DOS file "C:\SRC\PWLIB\FRED.TXT" this would be ".TXT" but on the Macintosh this might be "TEXT".

Note there are standard translations from file extensions, eg ".TXT" and some Macintosh file types, eg "TEXT".

string for the type part of the file specification.

Definition at line 734 of file ptlib.cxx.

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

Referenced by PRFC822Channel::SetContentAttachment().

  PINDEX slash = FindLast('\\');
  if (slash == P_MAX_INDEX)
    slash = 0;
  PINDEX dot = FindLast('.');
  if (dot < slash)
    return PCaselessString();
  return operator()(dot, P_MAX_INDEX);

Generated by  Doxygen 1.6.0   Back to index