Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
cMime.h
Go to the documentation of this file.
1 //
4 //
5 
6 #ifndef _INC_cMime_H
7 #define _INC_cMime_H
8 #ifndef NO_PRAGMA_ONCE
9 #pragma once
10 #endif
11 
12 #include "GrayCore.h"
13 
14 namespace Gray
15 {
16  // List of known file extensions. Was FILE_EXT_*
17  // NOT .dmp .dat .riff
18 #define MIME_EXT_unk ""
19 #define MIME_EXT_3ds ".3ds" // 3d Studio.
20 #define MIME_EXT_7z ".7z"
21 #define MIME_EXT_avi ".avi"
22 #define MIME_EXT_bin ".bin"
23 #define MIME_EXT_bmp ".bmp"
24 #define MIME_EXT_cer ".cer"
25 #define MIME_EXT_crl ".crl"
26 #define MIME_EXT_crt ".crt"
27 #define MIME_EXT_css ".css"
28 #define MIME_EXT_csv ".csv"
29 #define MIME_EXT_dae ".dae" // Collada
30 #define MIME_EXT_dds ".dds"
31 #define MIME_EXT_dll ".dll"
32 #define MIME_EXT_doc ".doc"
33 #define MIME_EXT_docx ".docx"
34 #define MIME_EXT_exe ".exe"
35 #define MIME_EXT_fbx ".fbx" // Film Box 3d model
36 #define MIME_EXT_flv ".flv"
37 #define MIME_EXT_gif ".gif"
38 #define MIME_EXT_htm ".htm"
39 #define MIME_EXT_html ".html"
40 #define MIME_EXT_htt ".htt"
41 #define MIME_EXT_ico ".ico"
42 #define MIME_EXT_ini ".ini"
43 #define MIME_EXT_jar ".jar"
44 #define MIME_EXT_jp2 ".jp2"
45 #define MIME_EXT_jpg ".jpg"
46 #define MIME_EXT_jpeg ".jpeg"
47 #define MIME_EXT_js ".js"
48 #define MIME_EXT_json ".json"
49 #define MIME_EXT_log ".log"
50 #define MIME_EXT_lua ".lua"
51 #define MIME_EXT_mp3 ".mp3"
52 #define MIME_EXT_mp4 ".mp4"
53 #define MIME_EXT_mpeg ".mpeg"
54 #define MIME_EXT_mpg ".mpg"
55  // #define MIME_EXT_obj ".obj" // Mesh model.
56 #define MIME_EXT_ocx ".ocx"
57 #define MIME_EXT_pdf ".pdf"
58 #define MIME_EXT_pem ".pem"
59 #define MIME_EXT_png ".png"
60 #define MIME_EXT_ppt ".ppt"
61 #define MIME_EXT_pptx ".pptx"
62 #define MIME_EXT_pvk ".pvk"
63 #define MIME_EXT_rtf ".rtf"
64 #define MIME_EXT_scp ".scp"
65 #define MIME_EXT_so ".so"
66 #define MIME_EXT_swf ".swf"
67 #define MIME_EXT_tga ".tga"
68 #define MIME_EXT_tif ".tif"
69 #define MIME_EXT_tiff ".tiff"
70 #define MIME_EXT_ttf ".ttf"
71 #define MIME_EXT_txt ".txt"
72 #define MIME_EXT_wav ".wav"
73 #define MIME_EXT_xls ".xls"
74 #define MIME_EXT_xlsx ".xlsx"
75 #define MIME_EXT_xml ".xml"
76 #define MIME_EXT_zip ".zip"
77 
78  enum MIME_TYPE
79  {
84 #define cMimeType(a,b,c,d,e) MIME_##a,
85 #include "cMimeTypes.tbl"
86 #undef cMimeType
88  };
89 
90  struct GRAYCORE_LINK cMime // static
91  {
96 
97  static const char* GRAYCALL GetMimeTypeName(MIME_TYPE eMimeType);
98  static MIME_TYPE GRAYCALL FindMimeTypeName(const char* pszName);
99 
100  static MIME_TYPE GRAYCALL FindMimeTypeForExt(const char* pszExt, MIME_TYPE eMimeTypeDefault = MIME_UNKNOWN);
101 
102  static const char* const k_aszMimeType[MIME_QTY + 1];
103  static const char* const k_aszMimeExt[(MIME_QTY * 2) + 1];
104  };
105 };
106 #endif
#define GRAYCORE_LINK
Definition: GrayCore.h:47
#define GRAYCALL
declare calling convention for static functions so everyone knows the arg passing scheme....
Definition: GrayCore.h:36
< The main namespace for all Core functions.
Definition: GrayCore.cpp:14
MIME_TYPE
Definition: cMime.h:79
@ MIME_QTY
Definition: cMime.h:87
Definition: cMime.h:91