oln::io::internal::utils Struct Reference

Utils for io (get extension of a file). More...

#include <utils.hh>

List of all members.

Static Public Member Functions

std::string extension (const std::string &name)
 Return the extension of a filename.
  • name The filename.



Detailed Description

Utils for io (get extension of a file).

Definition at line 44 of file utils.hh.


Member Function Documentation

std::string oln::io::internal::utils::extension const std::string &  name  )  [inline, static]
 

Return the extension of a filename.

  • name The filename.

Returns:
The extension (lower case).

Definition at line 53 of file utils.hh.

00054         {
00055           std::string ext;
00056           int pos = name.rfind('.');
00057           if (pos > 0)
00058           {
00059             ext.assign(name, pos + 1, name.size() - pos);
00060             for (std::string::iterator i = ext.begin(); i != ext.end(); ++i)
00061               *i = tolower(*i);
00062           }
00063           return ext;
00064         }


The documentation for this struct was generated from the following file:
Generated on Thu Apr 15 20:16:29 2004 for Olena by doxygen 1.3.6-20040222