|
1 | | -// Smdn.Fundamental.MimeType.dll (Smdn.Fundamental.MimeType-3.0.2) |
| 1 | +// Smdn.Fundamental.MimeType.dll (Smdn.Fundamental.MimeType-3.1.0) |
2 | 2 | // Name: Smdn.Fundamental.MimeType |
3 | | -// AssemblyVersion: 3.0.2.0 |
4 | | -// InformationalVersion: 3.0.2+53f78e8e599784381721a51f463d3202aeade3d8 |
| 3 | +// AssemblyVersion: 3.1.0.0 |
| 4 | +// InformationalVersion: 3.1.0+73609d14a9c7ae47c72f6d32f87ad6ebc0a2d166 |
5 | 5 | // TargetFramework: .NETFramework,Version=v4.7.1 |
6 | 6 | // Configuration: Release |
7 | 7 |
|
8 | 8 | using System; |
9 | 9 | using System.Collections.Generic; |
| 10 | +using System.Runtime.CompilerServices; |
10 | 11 | using Smdn; |
11 | 12 |
|
12 | 13 | namespace Smdn { |
| 14 | + [Nullable(byte.MinValue)] |
| 15 | + [NullableContext(1)] |
13 | 16 | [TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")] |
14 | 17 | public class MimeType : |
15 | 18 | IEquatable<MimeType>, |
16 | | - IEquatable<string> |
| 19 | + IEquatable<string>, |
| 20 | + IFormattable |
17 | 21 | { |
18 | 22 | public static readonly MimeType ApplicationOctetStream; // = "application/octet-stream" |
| 23 | + public static readonly MimeType ApplicationXWwwFormUrlEncoded; // = "application/x-www-form-urlencoded" |
19 | 24 | public static readonly MimeType MessageExternalBody; // = "message/external-body" |
20 | 25 | public static readonly MimeType MessagePartial; // = "message/partial" |
21 | 26 | public static readonly MimeType MessageRfc822; // = "message/rfc822" |
22 | 27 | public static readonly MimeType MultipartAlternative; // = "multipart/alternative" |
| 28 | + public static readonly MimeType MultipartDigest; // = "multipart/digest" |
| 29 | + public static readonly MimeType MultipartFormData; // = "multipart/form-data" |
23 | 30 | public static readonly MimeType MultipartMixed; // = "multipart/mixed" |
| 31 | + public static readonly MimeType MultipartParallel; // = "multipart/parallel" |
| 32 | + public static readonly MimeType TextHtml; // = "text/html" |
24 | 33 | public static readonly MimeType TextPlain; // = "text/plain" |
| 34 | + public static readonly MimeType TextRtf; // = "text/rtf" |
25 | 35 |
|
26 | | - public MimeType((string type, string subType) mimeType) {} |
| 36 | + public MimeType([Nullable] (string type, string subType) mimeType) {} |
27 | 37 | public MimeType(string mimeType) {} |
28 | 38 | public MimeType(string type, string subType) {} |
29 | 39 |
|
| 40 | + public bool IsApplication { get; } |
| 41 | + public bool IsApplicationOctetStream { get; } |
| 42 | + public bool IsApplicationXWwwFormUrlEncoded { get; } |
| 43 | + public bool IsAudio { get; } |
| 44 | + public bool IsFont { get; } |
| 45 | + public bool IsImage { get; } |
| 46 | + public bool IsMessage { get; } |
| 47 | + public bool IsMessageExternalBody { get; } |
| 48 | + public bool IsMessagePartial { get; } |
| 49 | + public bool IsMessageRfc822 { get; } |
| 50 | + public bool IsModel { get; } |
| 51 | + public bool IsMultipart { get; } |
| 52 | + public bool IsMultipartAlternative { get; } |
| 53 | + public bool IsMultipartDigest { get; } |
| 54 | + public bool IsMultipartFormData { get; } |
| 55 | + public bool IsMultipartMixed { get; } |
| 56 | + public bool IsMultipartParallel { get; } |
| 57 | + public bool IsText { get; } |
| 58 | + public bool IsTextHtml { get; } |
| 59 | + public bool IsTextPlain { get; } |
| 60 | + public bool IsVideo { get; } |
30 | 61 | public string SubType { get; } |
31 | 62 | public string Type { get; } |
32 | 63 |
|
33 | 64 | public static MimeType CreateApplicationType(string subtype) {} |
34 | 65 | public static MimeType CreateAudioType(string subtype) {} |
| 66 | + public static MimeType CreateFontType(string subtype) {} |
35 | 67 | public static MimeType CreateImageType(string subtype) {} |
| 68 | + public static MimeType CreateModelType(string subtype) {} |
36 | 69 | public static MimeType CreateMultipartType(string subtype) {} |
37 | 70 | public static MimeType CreateTextType(string subtype) {} |
38 | 71 | public static MimeType CreateVideoType(string subtype) {} |
39 | 72 | public void Deconstruct(out string type, out string subType) {} |
| 73 | + [Obsolete("Use `Equals(MimeType, StringComparison)` instead. This method will be changed to perform case-insensitive comparison in the future release.")] |
| 74 | + [NullableContext(2)] |
40 | 75 | public bool Equals(MimeType other) {} |
| 76 | + [NullableContext(2)] |
| 77 | + public bool Equals(MimeType other, StringComparison comparisonType) {} |
| 78 | + [NullableContext(byte.MinValue)] |
| 79 | + public bool Equals(ReadOnlySpan<char> other, StringComparison comparisonType = StringComparison.OrdinalIgnoreCase) {} |
| 80 | + [Obsolete("Use `Equals(string, StringComparison)` instead. This method will be changed to perform case-insensitive comparison in the future release.")] |
| 81 | + [NullableContext(2)] |
41 | 82 | public bool Equals(string other) {} |
| 83 | + [NullableContext(2)] |
| 84 | + public bool Equals(string other, StringComparison comparisonType) {} |
| 85 | + [NullableContext(2)] |
42 | 86 | public override bool Equals(object obj) {} |
| 87 | + [Obsolete("Use `Equals(MimeType, StringComparison)` instead.")] |
| 88 | + [NullableContext(2)] |
43 | 89 | public bool EqualsIgnoreCase(MimeType other) {} |
| 90 | + [Obsolete("Use `Equals(string, StringComparison)` instead.")] |
| 91 | + [NullableContext(2)] |
44 | 92 | public bool EqualsIgnoreCase(string other) {} |
45 | 93 | public static IEnumerable<string> FindExtensionsByMimeType(MimeType mimeType) {} |
46 | 94 | public static IEnumerable<string> FindExtensionsByMimeType(MimeType mimeType, string mimeTypesFile) {} |
47 | 95 | public static IEnumerable<string> FindExtensionsByMimeType(string mimeType) {} |
48 | 96 | public static IEnumerable<string> FindExtensionsByMimeType(string mimeType, string mimeTypesFile) {} |
49 | | - public static MimeType FindMimeTypeByExtension(string extensionOrPath) {} |
50 | | - public static MimeType FindMimeTypeByExtension(string extensionOrPath, string mimeTypesFile) {} |
| 97 | + [return: Nullable(2)] public static MimeType FindMimeTypeByExtension(string extensionOrPath) {} |
| 98 | + [return: Nullable(2)] public static MimeType FindMimeTypeByExtension(string extensionOrPath, string mimeTypesFile) {} |
51 | 99 | public override int GetHashCode() {} |
52 | | - public static (string type, string subType) Parse(string s) {} |
| 100 | + [NullableContext(byte.MinValue)] |
| 101 | + [return: Nullable(1)] public static MimeType Parse(ReadOnlySpan<char> s, [Nullable(2)] IFormatProvider provider = null) {} |
| 102 | + [Obsolete("The return type of this method will be changed to MimeType in the future release. Use Smdn.Formats.Mime.MimeTypeStringExtensions.Split() instead.")] |
| 103 | + [return: Nullable] public static (string type, string subType) Parse(string s) {} |
| 104 | + public static MimeType Parse(string s, [Nullable(2)] IFormatProvider provider = null) {} |
| 105 | + [Obsolete("Use `SubTypeEquals(MimeType, StringComparison)` instead. This method will be changed to perform case-insensitive comparison in the future release.")] |
| 106 | + [NullableContext(2)] |
53 | 107 | public bool SubTypeEquals(MimeType mimeType) {} |
| 108 | + [NullableContext(2)] |
| 109 | + public bool SubTypeEquals(MimeType mimeType, StringComparison comparisonType) {} |
| 110 | + [NullableContext(byte.MinValue)] |
| 111 | + public bool SubTypeEquals(ReadOnlySpan<char> subType, StringComparison comparisonType = StringComparison.OrdinalIgnoreCase) {} |
| 112 | + [Obsolete("Use `SubTypeEquals(string, StringComparison)` instead. This method will be changed to perform case-insensitive comparison in the future release.")] |
| 113 | + [NullableContext(2)] |
54 | 114 | public bool SubTypeEquals(string subType) {} |
| 115 | + [NullableContext(2)] |
| 116 | + public bool SubTypeEquals(string subType, StringComparison comparisonType) {} |
| 117 | + [Obsolete("Use `SubTypeEquals(MimeType, StringComparison)` instead.")] |
| 118 | + [NullableContext(2)] |
55 | 119 | public bool SubTypeEqualsIgnoreCase(MimeType mimeType) {} |
| 120 | + [Obsolete("Use `SubTypeEquals(string, StringComparison)` instead.")] |
| 121 | + [NullableContext(2)] |
56 | 122 | public bool SubTypeEqualsIgnoreCase(string subType) {} |
| 123 | + [NullableContext(2)] |
| 124 | + [return: Nullable(1)] public string ToString(string format, IFormatProvider formatProvider) {} |
57 | 125 | public override string ToString() {} |
58 | | - public static bool TryParse(string s, out (string type, string subType) result) {} |
| 126 | + [NullableContext(byte.MinValue)] |
| 127 | + public bool TryFormat(Span<char> destination, out int charsWritten, ReadOnlySpan<char> format, [Nullable(2)] IFormatProvider provider) {} |
| 128 | + [NullableContext(byte.MinValue)] |
| 129 | + public static bool TryParse(ReadOnlySpan<char> s, [Nullable(2)] IFormatProvider provider, [Nullable(1)] out MimeType result) {} |
| 130 | + [NullableContext(2)] |
| 131 | + public static bool TryParse(string s, IFormatProvider provider, [Nullable(1)] out MimeType result) {} |
| 132 | + [Obsolete("The method will be deprecated in the future release. Use Smdn.Formats.Mime.MimeTypeStringExtensions.TrySplit() instead.")] |
| 133 | + [NullableContext(2)] |
| 134 | + public static bool TryParse(string s, [Nullable] out (string type, string subType) result) {} |
| 135 | + [NullableContext(2)] |
59 | 136 | public static bool TryParse(string s, out MimeType result) {} |
| 137 | + [Obsolete("Use `TypeEquals(MimeType, StringComparison)` instead. This method will be changed to perform case-insensitive comparison in the future release.")] |
| 138 | + [NullableContext(2)] |
60 | 139 | public bool TypeEquals(MimeType mimeType) {} |
| 140 | + [NullableContext(2)] |
| 141 | + public bool TypeEquals(MimeType mimeType, StringComparison comparisonType) {} |
| 142 | + [NullableContext(byte.MinValue)] |
| 143 | + public bool TypeEquals(ReadOnlySpan<char> type, StringComparison comparisonType = StringComparison.OrdinalIgnoreCase) {} |
| 144 | + [Obsolete("Use `TypeEquals(string, StringComparison)` instead. This method will be changed to perform case-insensitive comparison in the future release.")] |
| 145 | + [NullableContext(2)] |
61 | 146 | public bool TypeEquals(string type) {} |
| 147 | + [NullableContext(2)] |
| 148 | + public bool TypeEquals(string type, StringComparison comparisonType) {} |
| 149 | + [Obsolete("Use `TypeEquals(MimeType, StringComparison)` instead.")] |
| 150 | + [NullableContext(2)] |
62 | 151 | public bool TypeEqualsIgnoreCase(MimeType mimeType) {} |
| 152 | + [Obsolete("Use `TypeEquals(string, StringComparison)` instead.")] |
| 153 | + [NullableContext(2)] |
63 | 154 | public bool TypeEqualsIgnoreCase(string type) {} |
| 155 | + [NullableContext(2)] |
64 | 156 | public static explicit operator string(MimeType mimeType) {} |
65 | 157 | } |
66 | 158 | } |
67 | 159 |
|
| 160 | +namespace Smdn.Formats.Mime { |
| 161 | + [Nullable(byte.MinValue)] |
| 162 | + [NullableContext(2)] |
| 163 | + public static class MimeTypeStringExtensions { |
| 164 | + [return: Nullable] public static (string Type, string SubType) Split(string mimeType) {} |
| 165 | + public static bool TrySplit(string mimeType, [Nullable] out (string Type, string SubType) result) {} |
| 166 | + } |
| 167 | +} |
| 168 | + |
0 commit comments