Skip to content

Commit 8bda4fb

Browse files
authored
Merge pull request #51 from smdn/releases/Smdn.Fundamental.MimeType-3.1.0-1650895805
Release main/Smdn.Fundamental.MimeType-3.1.0
2 parents 73609d1 + 7be3ff3 commit 8bda4fb

7 files changed

+889
-46
lines changed
Lines changed: 110 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,168 @@
1-
// Smdn.Fundamental.MimeType.dll (Smdn.Fundamental.MimeType-3.0.2)
1+
// Smdn.Fundamental.MimeType.dll (Smdn.Fundamental.MimeType-3.1.0)
22
// 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
55
// TargetFramework: .NETFramework,Version=v4.5
66
// Configuration: Release
77

88
using System;
99
using System.Collections.Generic;
10+
using System.Runtime.CompilerServices;
1011
using Smdn;
1112

1213
namespace Smdn {
14+
[Nullable(byte.MinValue)]
15+
[NullableContext(1)]
1316
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
1417
public class MimeType :
1518
IEquatable<MimeType>,
16-
IEquatable<string>
19+
IEquatable<string>,
20+
IFormattable
1721
{
1822
public static readonly MimeType ApplicationOctetStream; // = "application/octet-stream"
23+
public static readonly MimeType ApplicationXWwwFormUrlEncoded; // = "application/x-www-form-urlencoded"
1924
public static readonly MimeType MessageExternalBody; // = "message/external-body"
2025
public static readonly MimeType MessagePartial; // = "message/partial"
2126
public static readonly MimeType MessageRfc822; // = "message/rfc822"
2227
public static readonly MimeType MultipartAlternative; // = "multipart/alternative"
28+
public static readonly MimeType MultipartDigest; // = "multipart/digest"
29+
public static readonly MimeType MultipartFormData; // = "multipart/form-data"
2330
public static readonly MimeType MultipartMixed; // = "multipart/mixed"
31+
public static readonly MimeType MultipartParallel; // = "multipart/parallel"
32+
public static readonly MimeType TextHtml; // = "text/html"
2433
public static readonly MimeType TextPlain; // = "text/plain"
34+
public static readonly MimeType TextRtf; // = "text/rtf"
2535

26-
public MimeType((string type, string subType) mimeType) {}
36+
public MimeType([Nullable] (string type, string subType) mimeType) {}
2737
public MimeType(string mimeType) {}
2838
public MimeType(string type, string subType) {}
2939

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; }
3061
public string SubType { get; }
3162
public string Type { get; }
3263

3364
public static MimeType CreateApplicationType(string subtype) {}
3465
public static MimeType CreateAudioType(string subtype) {}
66+
public static MimeType CreateFontType(string subtype) {}
3567
public static MimeType CreateImageType(string subtype) {}
68+
public static MimeType CreateModelType(string subtype) {}
3669
public static MimeType CreateMultipartType(string subtype) {}
3770
public static MimeType CreateTextType(string subtype) {}
3871
public static MimeType CreateVideoType(string subtype) {}
3972
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)]
4075
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)]
4182
public bool Equals(string other) {}
83+
[NullableContext(2)]
84+
public bool Equals(string other, StringComparison comparisonType) {}
85+
[NullableContext(2)]
4286
public override bool Equals(object obj) {}
87+
[Obsolete("Use `Equals(MimeType, StringComparison)` instead.")]
88+
[NullableContext(2)]
4389
public bool EqualsIgnoreCase(MimeType other) {}
90+
[Obsolete("Use `Equals(string, StringComparison)` instead.")]
91+
[NullableContext(2)]
4492
public bool EqualsIgnoreCase(string other) {}
4593
public static IEnumerable<string> FindExtensionsByMimeType(MimeType mimeType) {}
4694
public static IEnumerable<string> FindExtensionsByMimeType(MimeType mimeType, string mimeTypesFile) {}
4795
public static IEnumerable<string> FindExtensionsByMimeType(string mimeType) {}
4896
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) {}
5199
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)]
53107
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)]
54114
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)]
55119
public bool SubTypeEqualsIgnoreCase(MimeType mimeType) {}
120+
[Obsolete("Use `SubTypeEquals(string, StringComparison)` instead.")]
121+
[NullableContext(2)]
56122
public bool SubTypeEqualsIgnoreCase(string subType) {}
123+
[NullableContext(2)]
124+
[return: Nullable(1)] public string ToString(string format, IFormatProvider formatProvider) {}
57125
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)]
59136
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)]
60139
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)]
61146
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)]
62151
public bool TypeEqualsIgnoreCase(MimeType mimeType) {}
152+
[Obsolete("Use `TypeEquals(string, StringComparison)` instead.")]
153+
[NullableContext(2)]
63154
public bool TypeEqualsIgnoreCase(string type) {}
155+
[NullableContext(2)]
64156
public static explicit operator string(MimeType mimeType) {}
65157
}
66158
}
67159

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+
Lines changed: 110 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,168 @@
1-
// Smdn.Fundamental.MimeType.dll (Smdn.Fundamental.MimeType-3.0.2)
1+
// Smdn.Fundamental.MimeType.dll (Smdn.Fundamental.MimeType-3.1.0)
22
// 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
55
// TargetFramework: .NETFramework,Version=v4.7.1
66
// Configuration: Release
77

88
using System;
99
using System.Collections.Generic;
10+
using System.Runtime.CompilerServices;
1011
using Smdn;
1112

1213
namespace Smdn {
14+
[Nullable(byte.MinValue)]
15+
[NullableContext(1)]
1316
[TypeForwardedFrom("Smdn, Version=3.0.0.0, Culture=neutral, PublicKeyToken=null")]
1417
public class MimeType :
1518
IEquatable<MimeType>,
16-
IEquatable<string>
19+
IEquatable<string>,
20+
IFormattable
1721
{
1822
public static readonly MimeType ApplicationOctetStream; // = "application/octet-stream"
23+
public static readonly MimeType ApplicationXWwwFormUrlEncoded; // = "application/x-www-form-urlencoded"
1924
public static readonly MimeType MessageExternalBody; // = "message/external-body"
2025
public static readonly MimeType MessagePartial; // = "message/partial"
2126
public static readonly MimeType MessageRfc822; // = "message/rfc822"
2227
public static readonly MimeType MultipartAlternative; // = "multipart/alternative"
28+
public static readonly MimeType MultipartDigest; // = "multipart/digest"
29+
public static readonly MimeType MultipartFormData; // = "multipart/form-data"
2330
public static readonly MimeType MultipartMixed; // = "multipart/mixed"
31+
public static readonly MimeType MultipartParallel; // = "multipart/parallel"
32+
public static readonly MimeType TextHtml; // = "text/html"
2433
public static readonly MimeType TextPlain; // = "text/plain"
34+
public static readonly MimeType TextRtf; // = "text/rtf"
2535

26-
public MimeType((string type, string subType) mimeType) {}
36+
public MimeType([Nullable] (string type, string subType) mimeType) {}
2737
public MimeType(string mimeType) {}
2838
public MimeType(string type, string subType) {}
2939

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; }
3061
public string SubType { get; }
3162
public string Type { get; }
3263

3364
public static MimeType CreateApplicationType(string subtype) {}
3465
public static MimeType CreateAudioType(string subtype) {}
66+
public static MimeType CreateFontType(string subtype) {}
3567
public static MimeType CreateImageType(string subtype) {}
68+
public static MimeType CreateModelType(string subtype) {}
3669
public static MimeType CreateMultipartType(string subtype) {}
3770
public static MimeType CreateTextType(string subtype) {}
3871
public static MimeType CreateVideoType(string subtype) {}
3972
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)]
4075
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)]
4182
public bool Equals(string other) {}
83+
[NullableContext(2)]
84+
public bool Equals(string other, StringComparison comparisonType) {}
85+
[NullableContext(2)]
4286
public override bool Equals(object obj) {}
87+
[Obsolete("Use `Equals(MimeType, StringComparison)` instead.")]
88+
[NullableContext(2)]
4389
public bool EqualsIgnoreCase(MimeType other) {}
90+
[Obsolete("Use `Equals(string, StringComparison)` instead.")]
91+
[NullableContext(2)]
4492
public bool EqualsIgnoreCase(string other) {}
4593
public static IEnumerable<string> FindExtensionsByMimeType(MimeType mimeType) {}
4694
public static IEnumerable<string> FindExtensionsByMimeType(MimeType mimeType, string mimeTypesFile) {}
4795
public static IEnumerable<string> FindExtensionsByMimeType(string mimeType) {}
4896
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) {}
5199
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)]
53107
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)]
54114
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)]
55119
public bool SubTypeEqualsIgnoreCase(MimeType mimeType) {}
120+
[Obsolete("Use `SubTypeEquals(string, StringComparison)` instead.")]
121+
[NullableContext(2)]
56122
public bool SubTypeEqualsIgnoreCase(string subType) {}
123+
[NullableContext(2)]
124+
[return: Nullable(1)] public string ToString(string format, IFormatProvider formatProvider) {}
57125
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)]
59136
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)]
60139
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)]
61146
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)]
62151
public bool TypeEqualsIgnoreCase(MimeType mimeType) {}
152+
[Obsolete("Use `TypeEquals(string, StringComparison)` instead.")]
153+
[NullableContext(2)]
63154
public bool TypeEqualsIgnoreCase(string type) {}
155+
[NullableContext(2)]
64156
public static explicit operator string(MimeType mimeType) {}
65157
}
66158
}
67159

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

Comments
 (0)