/MEng/System/Runtime/StringOutStream

ClassPath:MEng.System.Runtime.StringOutStream
Parent ClassPath:MEng.System.Runtime.TextOutStream
Copyable:No
Final:Yes

MEng.System.Runtime.StringOutStream is a derivative of the base text output stream, whose target is an MEng.String object. So it will format text directly to a string, which you can then get a copy of and you now have some formatted content in a string.

Since this class derives from the base text output stream, it inherits all of that class's functionality, so you can format all the same types of things to a console output stream. See the parent class documentation for details. Almost all of the functionality is in the parent class, so there are only a few methods defined at this level.

 

Constructors:

Constructor();
Constructor([In] MEng.Card4 InitSize);

There is a default constructor and an constructor that takes an initial allocation size for the string. If you have a rough idea of how many characters you will be formatted, it might be more efficient to indicate that, since it will require fewer expansions of the string as text is formatted into it.

 

Final, Non-Const Methods:

XCodeTo([Out] MemBuf ToFill, [In] String Encoding) Returns MEng.Card4;

This method will transcode all of the text in this stream's string buffer out to the passed memory buffer, using the indicated encoding. Be sure to flush the stream first to make sure all of the data is in the string.

 

Final, Const Methods:

GetText([Out] MEng.String ToFill);

This method will get a copy of the text streamed to this stream so far. Note that it will flush the stream first, to insure that any cached information has been flushed out to the target string before copying to the output parameter.

Reset();

This method will reset the output position of the stream back to the start, so that you can overwrite any previous output and start streaming new data to it. If you get a copy of the text after a reset, it will be an empty string.