Merge pull request #26220 from 78andyp/blurayfixes
[xbmc.git] / xbmc / utils / Mime.h
blob72cc7ab9610bdbaa2335fec1ea0b844ae61f0b55
1 /*
2 * Copyright (C) 2012-2018 Team Kodi
3 * This file is part of Kodi - https://kodi.tv
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 * See LICENSES/README.md for more information.
7 */
9 #pragma once
11 #include <string>
13 class CFileItem;
14 class CURL;
16 class CMime
18 public:
19 static std::string GetMimeType(const std::string &extension);
20 static std::string GetMimeType(const CFileItem &item);
21 static std::string GetMimeType(const CURL &url, bool lookup = true);
23 enum EFileType
25 FileTypeUnknown = 0,
26 FileTypeHtml,
27 FileTypeXml,
28 FileTypePlainText,
29 FileTypeZip,
30 FileTypeGZip,
31 FileTypeRar,
32 FileTypeBmp,
33 FileTypeGif,
34 FileTypePng,
35 FileTypeJpeg,
37 static EFileType GetFileTypeFromMime(const std::string& mimeType);
38 static EFileType GetFileTypeFromContent(const std::string& fileContent);
40 private:
41 static bool parseMimeType(const std::string& mimeType, std::string& type, std::string& subtype);