-
-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
cosullivan
committed
Aug 7, 2020
1 parent
ec415a0
commit 683cd96
Showing
36 changed files
with
3,726 additions
and
5,475 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
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 |
---|---|---|
@@ -1,23 +1,23 @@ | ||
using System; | ||
//using System; | ||
|
||
namespace SmtpServer | ||
{ | ||
public static class StringExtensions | ||
{ | ||
/// <summary> | ||
/// Returns a value indicating whether or not the given string is equal on a case insensitive comparisson. | ||
/// </summary> | ||
/// <param name="str">The string to compare.</param> | ||
/// <param name="test">The string to test against.</param> | ||
/// <returns>true if the strings are equal on a case insensitive comparisson.</returns> | ||
public static bool CaseInsensitiveEquals(this string str, string test) | ||
{ | ||
if (str == null) | ||
{ | ||
throw new ArgumentNullException(nameof(str)); | ||
} | ||
//namespace SmtpServer | ||
//{ | ||
// public static class StringExtensions | ||
// { | ||
// /// <summary> | ||
// /// Returns a value indicating whether or not the given string is equal on a case insensitive comparisson. | ||
// /// </summary> | ||
// /// <param name="str">The string to compare.</param> | ||
// /// <param name="test">The string to test against.</param> | ||
// /// <returns>true if the strings are equal on a case insensitive comparisson.</returns> | ||
// public static bool CaseInsensitiveEquals(this string str, string test) | ||
// { | ||
// if (str == null) | ||
// { | ||
// throw new ArgumentNullException(nameof(str)); | ||
// } | ||
|
||
return String.Equals(str, test, StringComparison.OrdinalIgnoreCase); | ||
} | ||
} | ||
} | ||
// return string.Equals(str, test, StringComparison.OrdinalIgnoreCase); | ||
// } | ||
// } | ||
//} |
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,39 @@ | ||
using System; | ||
using System.Buffers; | ||
|
||
namespace SmtpServer.IO | ||
{ | ||
internal sealed class ByteArraySegment : ReadOnlySequenceSegment<byte> | ||
{ | ||
internal ByteArraySegment(ReadOnlyMemory<byte> memory) | ||
{ | ||
Memory = memory; | ||
} | ||
|
||
internal ByteArraySegment Append(ref ReadOnlySequence<byte> sequence) | ||
{ | ||
var segment = this; | ||
|
||
var position = sequence.GetPosition(0); | ||
|
||
while (sequence.TryGet(ref position, out var memory)) | ||
{ | ||
segment = segment.Append(memory); | ||
} | ||
|
||
return segment; | ||
} | ||
|
||
internal ByteArraySegment Append(ReadOnlyMemory<byte> memory) | ||
{ | ||
var segment = new ByteArraySegment(memory) | ||
{ | ||
RunningIndex = RunningIndex + Memory.Length | ||
}; | ||
|
||
Next = segment; | ||
|
||
return segment; | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.