Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Consume/Consume.cs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ void ArrayBufferWriterUsage()
}
#endif

#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
void Base64Usage()
{
ReadOnlySpan<byte> source = default;
Expand Down
9 changes: 9 additions & 0 deletions src/ConsumeBclMemoryNoResolve/Consume.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
using System;
using System.Buffers.Text;

public class BclMemoryConsume
{
public Index GetIndex() => new Index(0);

public Range GetRange() => new Range(new Index(0), new Index(1));

// Microsoft.Bcl.Memory supplies Base64Url, but not these Base64 members,
// so Polyfill must still provide them when the package is referenced.
public string Base64Encode(ReadOnlySpan<byte> source) => Base64.EncodeToString(source);

public byte[] Base64Decode(ReadOnlySpan<char> source) => Base64.DecodeFromChars(source);

public string Base64UrlEncode(ReadOnlySpan<byte> source) => Base64Url.EncodeToString(source);
}
2 changes: 1 addition & 1 deletion src/Polyfill/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if FeatureMemory && !RefsBclMemory && !NET11_0_OR_GREATER
#if FeatureMemory && !NET11_0_OR_GREATER

namespace Polyfills;

Expand Down
2 changes: 1 addition & 1 deletion src/Split/net10.0/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/net461/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/net462/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/net47/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/net471/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/net472/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/net48/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/net481/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/net5.0/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/net6.0/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/net7.0/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/net8.0/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/net9.0/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/netcoreapp2.0/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/netcoreapp2.1/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/netcoreapp2.2/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/netcoreapp3.0/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/netcoreapp3.1/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/netstandard2.0/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/netstandard2.1/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
2 changes: 1 addition & 1 deletion src/Split/uap10.0/Base64Polyfill.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// <auto-generated />
#pragma warning disable
#if FeatureMemory && !RefsBclMemory
#if FeatureMemory
namespace Polyfills;
using System;
using System.Buffers;
Expand Down
Loading