Skip to content

Commit

Permalink
Expose basic IndentedStringBuilder API on ExpressionPrinter
Browse files Browse the repository at this point in the history
Part of #16733
  • Loading branch information
roji committed Jul 25, 2019
1 parent 17418aa commit 9436e3c
Showing 1 changed file with 44 additions and 2 deletions.
46 changes: 44 additions & 2 deletions src/EFCore/Query/ExpressionPrinter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,51 @@ public virtual void VisitList<T>(
}
}

private void Append([NotNull] string message) => _stringBuilder.Append(message);
public virtual ExpressionPrinter Append([NotNull] object o)
{
_stringBuilder.Append(o);
return this;
}

private void Append([NotNull] int value) => _stringBuilder.Append(value);
public virtual ExpressionPrinter AppendLine()
{
_stringBuilder.AppendLine();
return this;
}

public virtual ExpressionVisitor AppendLine([NotNull] object o)
{
_stringBuilder.AppendLine(o);
return this;
}

public virtual ExpressionPrinter AppendLines([NotNull] object o, bool skipFinalNewline = false)
{
_stringBuilder.AppendLines(o, skipFinalNewline);
return this;
}

public virtual ExpressionPrinter IncrementIndent()
{
_stringBuilder.IncrementIndent();
return this;
}

public virtual ExpressionPrinter IncrementIndent(bool connectNode)
{
_stringBuilder.IncrementIndent(connectNode);
return this;
}

public virtual ExpressionPrinter DecrementIndent()
{
_stringBuilder.DecrementIndent();
return this;
}

public virtual IDisposable Indent() => _stringBuilder.Indent();

private void Append([NotNull] string message) => _stringBuilder.Append(message);

private void AppendLine([NotNull] string message = "")
{
Expand Down

0 comments on commit 9436e3c

Please sign in to comment.