A helper type for printer objects; for details, please see ILNodePrinterHelper{S}, its derived interface ILNodePrinterHelperWithRevokableNewlines{S,C}, and the documentation of the constructor LNodePrinterHelper(StringBuilder, string, string, bool, string, string).
More...
A helper type for printer objects; for details, please see ILNodePrinterHelper{S}, its derived interface ILNodePrinterHelperWithRevokableNewlines{S,C}, and the documentation of the constructor LNodePrinterHelper(StringBuilder, string, string, bool, string, string).
|
|
| LNodePrinterHelper (StringBuilder s, Action< ILNode, IndexRange, int >?saveRange=null, bool allowNewlineRevocation=true, string indent="\t", string newline="\n", string labelIndent=" ", string bracketIndent=" ", int maxBracketIndents=4) |
| |
| virtual void | Reset () |
| | Calls Dispose() and resets the state of this object, like calling the constructor. Does not clear the StringBuilder. More...
|
| |
|
virtual LNodePrinterHelper | Write (char c) |
| | Appends a character to the output stream or StringBuilder.Do not call Write('
'); call Newline() instead.
|
| |
|
virtual LNodePrinterHelper | Write (string s) |
| | Appends a string to the output stream or StringBuilder.The string should not include newlines (if it might, call LNodePrinterHelperExt.WriteSmartly instead).
|
| |
|
virtual LNodePrinterHelper | Write (UString s) |
| | Appends a string to the output stream or StringBuilder.The string should not include newlines (if it might, call LNodePrinterHelperExt.WriteSmartly instead).
|
| |
|
LNodePrinterHelper | Space () |
| | Writes a space character unless the last character written was a space.
|
| |
|
StringBuilder | Append (string s) |
| |
|
StringBuilder | Append (UString s) |
| |
| LNodePrinterHelperLocation | Newline (int changeIndentLevel) |
| | Older version of Newline method, which returns a checkpoint instead of this. More...
|
| |
|
virtual LNodePrinterHelper | Newline (bool deferIndent=false) |
| | Appends a newline, with indentation afterward according to the current indentation level.- Parameters
-
| deferIndent | Requests that the indentation after the newline not be printed until Write or FlushIndent is called. This option is provided because you may know that you want to print a newline before deciding what indent is needed. |
|
| |
| LNodePrinterHelper | FlushIndent () |
| | Writes the pending indent, if applicable. This allows you to call Indent or Dedent afterward while making sure the indentation on the current line is unaffected. More...
|
| |
|
virtual LNodePrinterHelper | NewlineIsRequiredHere () |
| | Requests that a newline be written at this location. If this method is called multiple times at the same location, or if Newline(int) is called immediately afterward, only a single newline is written.This method does not officially write a newline; if you call this method followed by Dedent, for example, the newline that is eventually written will be followed by a lower amount of indentation.
|
| |
|
virtual LNodePrinterHelper | Indent (PrinterIndentHint?modeHint=null) |
| | Informs the helper that the printer is starting to write the specified node. The printer must call EndNode when it is done. This information may be used to record range information (to understand why this is useful, please read about LNodeRangeMapper)- Parameters
-
| node | The node that begins here. |
Increases the current indent level.
|
| |
|
virtual LNodePrinterHelper | Dedent (PrinterIndentHint?modeHint=null) |
| | Decreases the current indent level.- Parameters
-
| mode | If the hint is not null, the writer may be able to check that it was the same hint that was passed to Indent and throw an exception if not. |
- Exceptions
-
| ArgumentException | Hint provided doesn't match Indent hint |
|
| |
|
virtual LNodePrinterHelper | BeginNode (ILNode node) |
| |
|
virtual LNodePrinterHelper | EndNode () |
| | Informs the helper that the printer is done writing the most recently started node. The helper may save the range of the node, e.g. by calling ILNodePrinterOptions.SaveRange.- Parameters
-
| abort | Indicates that the range of this node should not be saved. |
|
| |
|
LNodePrinterHelper | BeginNode (ILNode node, PrinterIndentHint indentHint) |
| | Combines the BeginNode and Indent operations.- Parameters
-
| indentHint | Typically a member of PrinterIndentHint that influences how indentation is performed |
|
| |
|
LNodePrinterHelper | EndNode (PrinterIndentHint indentHint) |
| | Combines the EndNode and Dedent operations.
|
| |
|
virtual LNodePrinterHelperLocation | GetCheckpoint () |
| | Gets a value that can be passed later to RevokeNewlinesSince(Checkpoint).
|
| |
|
virtual LNodePrinterHelperLocation | NewlineAfterCheckpoint () |
| | Appends a newline, returning a checkpoint from with indentation afterward according to the current indentation level.
|
| |
|
int | RevokeOrCommitNewlines (LNodePrinterHelperLocation cp, int maxLineWidth) |
| |
|
LNodePrinterHelper | CommitNewlines () |
| | Commits all uncommitted newlines permanently.Also causes ranges after the uncommitted newlines to be saved.
|
| |
|
int | RevokeNewlinesSince (LNodePrinterHelperLocation cp) |
| |
| void | Dispose () |
| | Commits uncommitted newlines and node ranges. Throws if a SaveRange method was provided but EndNode has not been called the correct number of times. More...
|
| |
| int | RevokeNewlinesSince (Checkpoint cp) |
| | Deletes uncommitted newlines that were written after the specified checkpoint. More...
|
| |
| int | RevokeOrCommitNewlines (Checkpoint cp, int maxLineWidth) |
| | Revokes or commits newlines added since the specified checkpoint. Recent newlines are revoked if the combined line length after revokation does not exceed maxLineWidth, otherwise ALL newlines are committed permanently. More...
|
| |