Skip to content

Commit

Permalink
missing StringSyntax in TryFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp committed Dec 18, 2024
1 parent 7c0c740 commit 308e39e
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions src/Polyfill/Polyfill_TryFormat.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
// <auto-generated />

#pragma warning disable

namespace Polyfills;

using System;
using System.Diagnostics.CodeAnalysis;

static partial class Polyfill
{
Expand All @@ -13,7 +15,7 @@ static partial class Polyfill
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.timespan.tryformat#system-timespan-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this TimeSpan target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? formatProvider = null)
public static bool TryFormat(this TimeSpan target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, [StringSyntax(StringSyntaxAttribute.TimeSpanFormat)] IFormatProvider? formatProvider = null)
{
string result;

Expand All @@ -33,7 +35,7 @@ public static bool TryFormat(this TimeSpan target, Span<char> destination, out i
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.guid.tryformat#system-guid-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char)))
public static bool TryFormat(this Guid target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default)
public static bool TryFormat(this Guid target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.GuidFormat)] ReadOnlySpan<char> format = default)
{
string result;

Expand All @@ -53,7 +55,7 @@ public static bool TryFormat(this Guid target, Span<char> destination, out int c
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.sbyte.tryformat#system-sbyte-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this sbyte target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this sbyte target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, [StringSyntax(StringSyntaxAttribute.NumericFormat)] IFormatProvider? provider = default)
{
string result;

Expand All @@ -73,7 +75,7 @@ public static bool TryFormat(this sbyte target, Span<char> destination, out int
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.byte.tryformat#system-byte-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this byte target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this byte target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
{
string result;

Expand All @@ -93,7 +95,7 @@ public static bool TryFormat(this byte target, Span<char> destination, out int c
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.int16.tryformat#system-int16-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this short target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this short target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
{
string result;

Expand All @@ -113,7 +115,7 @@ public static bool TryFormat(this short target, Span<char> destination, out int
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.uint16.tryformat#system-uint16-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this ushort target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this ushort target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
{
string result;

Expand All @@ -133,7 +135,7 @@ public static bool TryFormat(this ushort target, Span<char> destination, out int
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.int32.tryformat#system-int32-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this int target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this int target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
{
string result;

Expand All @@ -153,7 +155,7 @@ public static bool TryFormat(this int target, Span<char> destination, out int ch
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.uint32.tryformat#system-uint32-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this uint target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this uint target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
{
string result;

Expand All @@ -173,7 +175,7 @@ public static bool TryFormat(this uint target, Span<char> destination, out int c
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.int64.tryformat#system-int64-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this long target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this long target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
{
string result;

Expand All @@ -193,7 +195,7 @@ public static bool TryFormat(this long target, Span<char> destination, out int c
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.uint64.tryformat#system-uint64-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this ulong target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this ulong target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
{
string result;

Expand All @@ -213,7 +215,7 @@ public static bool TryFormat(this ulong target, Span<char> destination, out int
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.single.tryformat#system-single-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this float target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this float target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
{
string result;

Expand All @@ -233,7 +235,7 @@ public static bool TryFormat(this float target, Span<char> destination, out int
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.double.tryformat#system-double-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this double target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this double target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
{
string result;

Expand All @@ -253,7 +255,7 @@ public static bool TryFormat(this double target, Span<char> destination, out int
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.decimal.tryformat#system-decimal-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this decimal target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this decimal target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.NumericFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
{
string result;

Expand Down Expand Up @@ -285,7 +287,7 @@ public static bool TryFormat(this bool target, Span<char> destination, out int c
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.datetimeoffset.tryformat#system-datetimeoffset-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this DateTimeOffset target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this DateTimeOffset target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.DateTimeFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
{
string result;

Expand All @@ -305,7 +307,7 @@ public static bool TryFormat(this DateTimeOffset target, Span<char> destination,
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.datetime.tryformat#system-datetime-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this DateTime target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this DateTime target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
{
string result;

Expand All @@ -328,7 +330,7 @@ public static bool TryFormat(this DateTime target, Span<char> destination, out i
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.dateonly.tryformat#system-dateonly-tryformat(system-span((system-char))-system-int32@-system-readonlyspan((system-char))-system-iformatprovider)
public static bool TryFormat(this DateOnly target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this DateOnly target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.DateOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
{
string result;

Expand All @@ -348,7 +350,7 @@ public static bool TryFormat(this DateOnly target, Span<char> destination, out i
/// Tries to format the value of the current instance into the provided span of characters.
/// </summary>
//Link: https://learn.microsoft.com/en-us/dotnet/api/system.timeonly.tryformat
public static bool TryFormat(this TimeOnly target, Span<char> destination, out int charsWritten, ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
public static bool TryFormat(this TimeOnly target, Span<char> destination, out int charsWritten, [StringSyntax(StringSyntaxAttribute.TimeOnlyFormat)] ReadOnlySpan<char> format = default, IFormatProvider? provider = default)
{
string result;

Expand Down

0 comments on commit 308e39e

Please sign in to comment.