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

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".

Returns:
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 Emailtest::Main(), and 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);
}

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