-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update to metadata v10.0.19041.5-preview.20
- Loading branch information
Showing
8 changed files
with
374 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/// <summary> | ||
/// A pointer to a constant character string. | ||
/// </summary> | ||
[DebuggerDisplay("{" + nameof(DebuggerDisplay) + "}")] | ||
internal unsafe readonly partial struct PCSTR : IEquatable<PCSTR> | ||
{ | ||
/// <summary> | ||
/// A pointer to the first character in the string. The content should be considered readonly, as it was typed as constant in the SDK. | ||
/// </summary> | ||
internal readonly byte* Value; | ||
internal PCSTR(byte* value) => this.Value = value; | ||
public static implicit operator byte*(PCSTR value) => value.Value; | ||
public static explicit operator PCSTR(byte* value) => new PCSTR(value); | ||
public static implicit operator PCSTR(PSTR value) => new PCSTR(value.Value); | ||
public bool Equals(PCSTR other) => this.Value == other.Value; | ||
public override bool Equals(object obj) => obj is PCSTR other && this.Equals(other); | ||
public override int GetHashCode() => unchecked((int)this.Value); | ||
|
||
/// <summary> | ||
/// Gets the number of characters up to the first null character (exclusive). | ||
/// </summary> | ||
internal int Length | ||
{ | ||
get | ||
{ | ||
byte* p = this.Value; | ||
if (p is null) | ||
return 0; | ||
while (*p != 0) | ||
p++; | ||
return checked((int)(p - this.Value)); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Returns a <see langword="string"/> with a copy of this character array, decoding as UTF-8. | ||
/// </summary> | ||
/// <returns>A <see langword="string"/>, or <see langword="null"/> if <see cref="Value"/> is <see langword="null"/>.</returns> | ||
public override string ToString() => this.Value is null ? null : new string((sbyte*)this.Value, 0, this.Length, global::System.Text.Encoding.UTF8); | ||
|
||
/// <summary> | ||
/// Returns a span of the characters in this string. | ||
/// </summary> | ||
internal ReadOnlySpan<byte> AsSpan() => this.Value is null ? default(ReadOnlySpan<byte>) : new ReadOnlySpan<byte>(this.Value, this.Length); | ||
|
||
private string DebuggerDisplay => this.ToString(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
/// <summary> | ||
/// A pointer to a constant character string. | ||
/// </summary> | ||
[DebuggerDisplay("{" + nameof(DebuggerDisplay) + "}")] | ||
internal unsafe readonly partial struct PCWSTR : IEquatable<PCWSTR> | ||
{ | ||
/// <summary> | ||
/// A pointer to the first character in the string. The content should be considered readonly, as it was typed as constant in the SDK. | ||
/// </summary> | ||
internal readonly char* Value; | ||
internal PCWSTR(char* value) => this.Value = value; | ||
public static explicit operator char*(PCWSTR value) => value.Value; | ||
public static implicit operator PCWSTR(char* value) => new PCWSTR(value); | ||
public static implicit operator PCWSTR(PWSTR value) => new PCWSTR(value.Value); | ||
public bool Equals(PCWSTR other) => this.Value == other.Value; | ||
public override bool Equals(object obj) => obj is PCWSTR other && this.Equals(other); | ||
public override int GetHashCode() => unchecked((int)this.Value); | ||
|
||
/// <summary> | ||
/// Gets the number of characters up to the first null character (exclusive). | ||
/// </summary> | ||
internal int Length | ||
{ | ||
get | ||
{ | ||
char* p = this.Value; | ||
if (p is null) | ||
return 0; | ||
while (*p != '\0') | ||
p++; | ||
return checked((int)(p - this.Value)); | ||
} | ||
} | ||
|
||
/// <summary> | ||
/// Returns a <see langword="string"/> with a copy of this character array. | ||
/// </summary> | ||
/// <returns>A <see langword="string"/>, or <see langword="null"/> if <see cref="Value"/> is <see langword="null"/>.</returns> | ||
public override string ToString() => this.Value is null ? null : new string(this.Value); | ||
|
||
/// <summary> | ||
/// Returns a span of the characters in this string. | ||
/// </summary> | ||
internal ReadOnlySpan<char> AsSpan() => this.Value is null ? default(ReadOnlySpan<char>) : new ReadOnlySpan<char>(this.Value, this.Length); | ||
|
||
private string DebuggerDisplay => this.ToString(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,5 @@ SpellCheckerFactory | |
ISpellCheckerFactory | ||
ISpellChecker | ||
CLSCTX | ||
S_FALSE | ||
S_FALSE | ||
S_OK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters