JayBeams  0.1
Another project to have fun coding.
filetype.cpp
Go to the documentation of this file.
1 #include "jb/filetype.hpp"
2 
3 bool jb::is_gz(std::string const& filename) {
4  char const ext[] = ".gz";
5  constexpr std::size_t elen = sizeof(ext) - 1;
6  auto len = filename.length();
7  if (filename.length() <= elen) {
8  return false;
9  }
10  return 0 == filename.compare(len - elen, elen, ext);
11 }
bool is_gz(std::string const &filename)
Return true if the filename ends in .gz.
Definition: filetype.cpp:3