mlpack 3.4.2
extension.hpp
Go to the documentation of this file.
1
13#ifndef MLPACK_CORE_DATA_EXTENSION_HPP
14#define MLPACK_CORE_DATA_EXTENSION_HPP
15
16#include <mlpack/prereqs.hpp>
17
18namespace mlpack {
19namespace data {
20
21inline std::string Extension(const std::string& filename)
22{
23 const size_t ext = filename.rfind('.');
24 std::string extension;
25 if (ext == std::string::npos)
26 return extension;
27
28 extension = filename.substr(ext + 1);
29 std::transform(extension.begin(), extension.end(), extension.begin(),
30 ::tolower);
31
32 return extension;
33}
34
35} // namespace data
36} // namespace mlpack
37
38#endif
std::string Extension(const std::string &filename)
Definition: extension.hpp:21
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.