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

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


Detailed Description

Utils for io (get extension of a file).

Definition at line 44 of file io/utils.hh.


Member Function Documentation

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

Return the extension of a filename.

Definition at line 53 of file io/utils.hh.

Referenced by oln::io::internal::stream_wrapper< StreamGz >::adjust_name(), oln::io::internal::try_stream_wrappers_in< W, T, Reader >::by_data(), oln::io::internal::try_stream_wrappers_out< W, T, Writer >::by_extension(), oln::io::internal::try_stream_wrappers_in< W, T, Reader >::by_extension(), oln::io::internal::read(), and oln::io::internal::write().

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 Tue Feb 20 20:27:27 2007 for Olena by  doxygen 1.5.1