forked from axuno/SmartFormat
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
No more Cysharp.Text classes used in SmartFormat namespace (axuno#228)
Breaking change to version/3.0-alpha.4 * Created ZStringBuilder as a wrapper around Utf16ValueStringBuilder * Replaced occurrences of Utf16ValueStringBuilder with ZStringBuilder. * Affects IOutput, NullOutput, StringOutput, TextWriterOoutput, ZStringOutput
- Loading branch information
Showing
19 changed files
with
547 additions
and
56 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
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
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
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
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
26 changes: 26 additions & 0 deletions
26
src/SmartFormat.Tests/TestUtils/FormattingInfoExtensions.cs
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,26 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using SmartFormat.Core.Formatting; | ||
using SmartFormat.Core.Output; | ||
using SmartFormat.Core.Settings; | ||
|
||
namespace SmartFormat.Tests.TestUtils | ||
{ | ||
internal static class FormattingInfoExtensions | ||
{ | ||
/// <summary> | ||
/// Creates a new instance of <see cref="FormattingInfo"/>. | ||
/// </summary> | ||
/// <param name="format">The input format string.</param> | ||
/// <param name="data">The data argument.</param> | ||
/// <returns>A new instance of <see cref="FormattingInfo"/>.</returns> | ||
public static FormattingInfo Create(string format, IList<object?> data) | ||
{ | ||
var formatter = new SmartFormatter(new SmartSettings()); | ||
var formatParsed = formatter.Parser.ParseFormat(format); | ||
// use StringOutput because we don't have to care about disposing. | ||
var formatDetails = new FormatDetails(formatter, formatParsed, data, null, new StringOutput()); | ||
return new FormattingInfo(formatDetails, formatDetails.OriginalFormat, data); | ||
} | ||
} | ||
} |
Oops, something went wrong.