smartinspectpython.sitextcontext
Is the base class for all viewer contexts which deal with text data. A viewer context is the library-side representation of a viewer in the Console.
Threadsafety:
This class is not guaranteed to be thread-safe.
Initializes a new instance of the class.
Arguments:
- vi (SIViewerId): The viewer ID to use.
Overridden. Returns the actual data which will be displayed in the viewer specified by the viewer id.
Appends a line to the text data.
Arguments:
- line (str): The line to append.
Raises:
- SIArgumentNullException: The line argument is null.
This method appends the supplied line and a carriage return
- linefeed character to the internal text data after it has been escaped by the EscapeLine method.
Appends text.
Arguments:
- Text (str): The text to append.
Raises:
- SIArgumentNullException: The text argument is null.
Releases any resources.
Arguments:
- disposing (bool): True if managed resources should be released and false otherwise.
Escapes a line.
Arguments:
- line (str): The line to escape.
Returns:
The escaped line.
If overridden in derived classes, this method escapes a line depending on the viewer format used. The default implementation does no escaping.
Loads the text from a file.
Arguments:
- (str): The name of the file to load the text from.
Raises:
- SIArgumentNullException: The filename argument is null.
- IOException: An I/O error occurred.
Loads the text from a reader.
Arguments:
- reader (TextIOWrapper): The reader to read the text from.
Raises:
- SIArgumentNullException: The reader argument is null.
- IOException: An I/O error occurred.
If the supplied text reader supports seeking then the entire text reader content will be read and the stream position will be restored correctly. Otherwise the data will be read from the current position to the end and the original position can not be restored.
Loads the text from a stream.
Arguments:
- stream (TextIOWrapper): The stream to load the text from.
Raises:
- SIArgumentNullException: The stream argument is null.
- IOException: An I/O error occurred.
If the supplied stream supports seeking then the entire stream content will be read and the stream position will be restored correctly. Otherwise the data will be read from the current position to the end and the original position can not be restored.