@@ -9,6 +9,16 @@ namespace Smdn;
99 */
1010[ System . Runtime . CompilerServices . TypeForwardedFrom ( "Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null" ) ]
1111public partial class MimeType {
12+ private const string TopLevelTypeApplication = "application" ;
13+ private const string TopLevelTypeAudio = "audio" ;
14+ private const string TopLevelTypeImage = "image" ;
15+ private const string TopLevelTypeMessage = "message" ;
16+ private const string TopLevelTypeMultipart = "multipart" ;
17+ private const string TopLevelTypeText = "text" ;
18+ private const string TopLevelTypeVideo = "video" ;
19+ private const string TopLevelTypeModel = "model" ; // [RFC2077] The Model Primary Content Type for Multipurpose Internet Mail Extensions
20+ private const string TopLevelTypeFont = "font" ; // [RFC8081] The "font" Top-Level Media Type
21+
1222 /*
1323 * class members
1424 */
@@ -22,21 +32,21 @@ public partial class MimeType {
2232 public static readonly MimeType MultipartFormData = CreateMultipartType ( "form-data" ) ; // [RFC7578]
2333 public static readonly MimeType ApplicationOctetStream = CreateApplicationType ( "octet-stream" ) ; // [RFC2046]
2434 public static readonly MimeType ApplicationXWwwFormUrlEncoded = CreateApplicationType ( "x-www-form-urlencoded" ) ; // WHATWG
25- public static readonly MimeType MessagePartial = new ( "message" , "partial" ) ; // [RFC2046]
26- public static readonly MimeType MessageExternalBody = new ( "message" , "external-body" ) ; // [RFC2046]
27- public static readonly MimeType MessageRfc822 = new ( "message" , "rfc822" ) ; // [RFC2046]
35+ public static readonly MimeType MessagePartial = new ( TopLevelTypeMessage , "partial" ) ; // [RFC2046]
36+ public static readonly MimeType MessageExternalBody = new ( TopLevelTypeMessage , "external-body" ) ; // [RFC2046]
37+ public static readonly MimeType MessageRfc822 = new ( TopLevelTypeMessage , "rfc822" ) ; // [RFC2046]
2838
2939 // TODO: rename param `subtype` to `subType`
30- public static MimeType CreateTextType ( string subtype ) => new ( "text" , subtype ) ;
31- public static MimeType CreateImageType ( string subtype ) => new ( "image" , subtype ) ;
32- public static MimeType CreateAudioType ( string subtype ) => new ( "audio" , subtype ) ;
33- public static MimeType CreateVideoType ( string subtype ) => new ( "video" , subtype ) ;
34- public static MimeType CreateApplicationType ( string subtype ) => new ( "application" , subtype ) ;
35- public static MimeType CreateMultipartType ( string subtype ) => new ( "multipart" , subtype ) ;
40+ public static MimeType CreateTextType ( string subtype ) => new ( TopLevelTypeText , subtype ) ;
41+ public static MimeType CreateImageType ( string subtype ) => new ( TopLevelTypeImage , subtype ) ;
42+ public static MimeType CreateAudioType ( string subtype ) => new ( TopLevelTypeAudio , subtype ) ;
43+ public static MimeType CreateVideoType ( string subtype ) => new ( TopLevelTypeVideo , subtype ) ;
44+ public static MimeType CreateApplicationType ( string subtype ) => new ( TopLevelTypeApplication , subtype ) ;
45+ public static MimeType CreateMultipartType ( string subtype ) => new ( TopLevelTypeMultipart , subtype ) ;
3646 // [RFC2077] The Model Primary Content Type for Multipurpose Internet Mail Extensions
37- public static MimeType CreateModelType ( string subtype ) => new ( "model" , subtype ) ;
47+ public static MimeType CreateModelType ( string subtype ) => new ( TopLevelTypeModel , subtype ) ;
3848 // [RFC8081] The "font" Top-Level Media Type
39- public static MimeType CreateFontType ( string subtype ) => new ( "font" , subtype ) ;
49+ public static MimeType CreateFontType ( string subtype ) => new ( TopLevelTypeFont , subtype ) ;
4050
4151 /*
4252 * instance members
0 commit comments