Mercurial > hg > orthanc
comparison Core/Enumerations.cpp @ 2984:db8f360fcb41
OrthancPluginAutodetectMimeType()
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sat, 08 Dec 2018 20:59:37 +0100 |
parents | cb5d75143da0 |
children | fd587cf51a89 4e43e67f8ecf |
comparison
equal
deleted
inserted
replaced
2983:af068a6b476b | 2984:db8f360fcb41 |
---|---|
49 static const char* const MIME_GIF = "image/gif"; | 49 static const char* const MIME_GIF = "image/gif"; |
50 static const char* const MIME_GZIP = "application/gzip"; | 50 static const char* const MIME_GZIP = "application/gzip"; |
51 static const char* const MIME_HTML = "text/html"; | 51 static const char* const MIME_HTML = "text/html"; |
52 static const char* const MIME_JAVASCRIPT = "application/javascript"; | 52 static const char* const MIME_JAVASCRIPT = "application/javascript"; |
53 static const char* const MIME_JPEG2000 = "image/jp2"; | 53 static const char* const MIME_JPEG2000 = "image/jp2"; |
54 static const char* const MIME_NACL = "application/x-nacl"; | |
54 static const char* const MIME_PLAIN_TEXT = "text/plain"; | 55 static const char* const MIME_PLAIN_TEXT = "text/plain"; |
56 static const char* const MIME_PNACL = "application/x-pnacl"; | |
57 static const char* const MIME_SVG = "image/svg+xml"; | |
55 static const char* const MIME_WEB_ASSEMBLY = "application/wasm"; | 58 static const char* const MIME_WEB_ASSEMBLY = "application/wasm"; |
59 static const char* const MIME_WOFF = "application/x-font-woff"; | |
56 static const char* const MIME_XML_2 = "text/xml"; | 60 static const char* const MIME_XML_2 = "text/xml"; |
57 static const char* const MIME_ZIP = "application/zip"; | 61 static const char* const MIME_ZIP = "application/zip"; |
58 | 62 |
59 // This function is autogenerated by the script | 63 // This function is autogenerated by the script |
60 // "Resources/GenerateErrorCodes.py" | 64 // "Resources/GenerateErrorCodes.py" |
1086 return MIME_GIF; | 1090 return MIME_GIF; |
1087 | 1091 |
1088 case MimeType_Zip: | 1092 case MimeType_Zip: |
1089 return MIME_ZIP; | 1093 return MIME_ZIP; |
1090 | 1094 |
1095 case MimeType_NaCl: | |
1096 return MIME_NACL; | |
1097 | |
1098 case MimeType_PNaCl: | |
1099 return MIME_PNACL; | |
1100 | |
1101 case MimeType_Svg: | |
1102 return MIME_SVG; | |
1103 | |
1104 case MimeType_Woff: | |
1105 return MIME_WOFF; | |
1106 | |
1091 default: | 1107 default: |
1092 throw OrthancException(ErrorCode_ParameterOutOfRange); | 1108 throw OrthancException(ErrorCode_ParameterOutOfRange); |
1093 } | 1109 } |
1094 } | 1110 } |
1095 | 1111 |
1677 return MimeType_Gif; | 1693 return MimeType_Gif; |
1678 } | 1694 } |
1679 else if (mime == MIME_ZIP) | 1695 else if (mime == MIME_ZIP) |
1680 { | 1696 { |
1681 return MimeType_Zip; | 1697 return MimeType_Zip; |
1698 } | |
1699 else if (mime == MIME_NACL) | |
1700 { | |
1701 return MimeType_NaCl; | |
1702 } | |
1703 else if (mime == MIME_PNACL) | |
1704 { | |
1705 return MimeType_PNaCl; | |
1706 } | |
1707 else if (mime == MIME_SVG) | |
1708 { | |
1709 return MimeType_Svg; | |
1710 } | |
1711 else if (mime == MIME_WOFF) | |
1712 { | |
1713 return MimeType_Woff; | |
1682 } | 1714 } |
1683 else | 1715 else |
1684 { | 1716 { |
1685 throw OrthancException(ErrorCode_ParameterOutOfRange); | 1717 throw OrthancException(ErrorCode_ParameterOutOfRange); |
1686 } | 1718 } |