///<inheritdoc/> public void Write(ZStringBuilder stringBuilder, IFormattingInfo formattingInfo) { #if NETSTANDARD2_1 output.Append(stringBuilder.AsSpan()); #else output.Append(stringBuilder.ToString()); #endif }
///<inheritdoc/> public void Write(ZStringBuilder stringBuilder, IFormattingInfo?formattingInfo = null) { #if NETSTANDARD2_1 Output.Write(stringBuilder.AsSpan()); #else Output.Write(stringBuilder.ToString()); #endif }
/// <summary> /// Creates a new instance of <see cref="ZStringBuilder"/> with the given initial capacity. /// </summary> /// <param name="capacity">The estimated capacity required. This will reduce or avoid incremental buffer increases.</param> internal static ZStringBuilder CreateZStringBuilder(int capacity) { var sb = new ZStringBuilder(false); if (capacity > DefaultBufferSize) { sb.Grow(capacity - DefaultBufferSize); } return(sb); }
///<inheritdoc/> public void Write(ZStringBuilder stringBuilder, IFormattingInfo?formattingInfo = null) { Output.Append(stringBuilder); }
/// <summary> /// Creates a new instance of <see cref="ZStringOutput"/> using the given <see cref="ZStringBuilder"/>. /// </summary> public ZStringOutput(ZStringBuilder stringBuilder) { Output = stringBuilder; }
/// <summary> /// Creates a new instance of <see cref="ZStringOutput"/> with the given initial capacity. /// </summary> /// <param name="capacity">The estimated capacity required. This will reduce or avoid incremental buffer increases.</param> public ZStringOutput(int capacity) { Output = Utilities.ZStringBuilderExtensions.CreateZStringBuilder(capacity); }
/// <summary> /// Creates a new instance of <see cref="ZStringOutput"/>. /// </summary> public ZStringOutput() { Output = Utilities.ZStringBuilderExtensions.CreateZStringBuilder(); }
///<inheritdoc/> public void Write(ZStringBuilder stringBuilder, IFormattingInfo?formattingInfo = null) { // Nothing to do here }