cpp-filetype
 
Loading...
Searching...
No Matches
type.hpp
1#ifndef FILETYPE_TYPE_HPP
2#define FILETYPE_TYPE_HPP
3
4#include <string>
5
6namespace filetype {
7
9struct Type {
10 std::string mime;
11 std::string extension;
12
13 Type(const std::string& m, const std::string& ext) : mime(m), extension(ext) {}
14
15 bool operator==(const Type& other) const {
16 return mime == other.mime && extension == other.extension;
17 }
18};
19
20} // namespace filetype
21
22#endif // FILETYPE_TYPE_HPP
Common Type struct used across all file formats.
Definition type.hpp:9
std::string extension
File extension without the dot.
Definition type.hpp:11
std::string mime
MIME type of the file.
Definition type.hpp:10