TextLog

References
public class TextLog : IDisposable
Used for collecting text data

Constructors

TextLog

#Since v5.1
Creates a text log that stores all text in memory. Use ToString on this version of the TextLog to get the text that we written
public TextLog()

TextLog

#Since v6.0
public TextLog(
nint
ptr
)

TextLog

#Since v5.1
Creates a text log that writes all text to a file. If no filename is provided, then text is written to StdOut
public TextLog(
filename
Name of file to create and write to. If null, then text output is sent to StdOut
)

Finalizer

~TextLog

#
Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().
~TextLog()

Properties

IndentSize

#Since v5.1
0: one tab per indent. >0: number of spaces per indent
public int IndentSize { get; set; }

Methods

Dispose

#Since v5.1
Actively reclaims unmanaged resources that this instance uses.
public void Dispose()

Dispose

#
For derived class implementers.

This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.

You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.

Also, you must call the base virtual method within your overriding method.

protected virtual void Dispose(
disposing
true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer.
)

NewCommandLine

#Since v7.0
Returns a reference to a TextLog that prints to the Rhino command line. Each new command line reference holds its own indents.
public static TextLog NewCommandLine()
Remarks: All Print methods of this instance are guaranteed to be thread safe. Other methods are not guaranteed to be thread safe.

PopIndent

#ExampleSince v5.1
Decrease the indentation level
public void PopIndent()

PrintWrappedText

#Since v5.1
Send text wrapped at a set line length
public void PrintWrappedText(
text,
lineLength
)

PushIndent

#ExampleSince v5.1
Increase the indentation level
public void PushIndent()

ResetString

#Since v9.0
If the TextLog was constructed using the empty constructor, then the text information is stored in a runtime string. This function resets the data held by the string, but retains the strings allocated memory to allow for quicker logging because the stored string doesn't constantly need to reallocate.
public void ResetString()

ToString

#
If the TextLog was constructed using the empty constructor, then the text information is stored in a runtime string. The contents of this string is retrieved using ToString for this case
public override string ToString()
Object.ToString