#include <vector>
#include <map>
+#include <xdgmime.h>
#include <dpl/utils/mime_type_utils.h>
}
}
}
- //TODO step 10 - sniff
+
+ // step 10 - sniff
+ std::string filePath = DPL::ToUTF8String(path);
+
+ std::string mime = xdg_mime_get_mime_type_for_file(filePath.c_str(), 0);
+ if (!mime.empty()) {
+ return DPL::FromASCIIString(mime);
+ }
return DPL::FromASCIIString("application/sniff");
}