TextLog

References
public class TextLog : IDisposable
Used for collecting text data

Constructors

TextLog

#Since v5.1
public TextLog()
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

TextLog

#Since v6.0
public TextLog(nint ptr)
ptr (nint)

TextLog

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

Finalizer

~TextLog

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

Properties

IndentSize

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

Methods

Dispose

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

Dispose

#
protected virtual void Dispose(bool disposing)
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.

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

NewCommandLine

#Since v7.0
public static TextLog NewCommandLine()
Returns a reference to a TextLog that prints to the Rhino command line. Each new command line reference holds its own indents.
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
public void PopIndent()
Decrease the indentation level

PrintWrappedText

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

PushIndent

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

ResetString

#Since v9.0
public void ResetString()
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.

ToString

#
public override string 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
Object.ToString