This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRISOpens in a new window, see the InterSystems IRIS Adoption Guide and the InterSystems IRIS In-Place Conversion Guide, both available on the WRC Distributions pageOpens in a new window (login required).

Caché & Ensemble 2018.1.5Opens in a new window > Class Reference > %SYS namespace > %IO.StringStream

%IO.StringStream

class %IO.StringStream extends %IO.I.CharacterSeekableStream

A stream class that uses a String for its storage. The underlying String may be in any supported encoding; Set the CharEncoding property to control the interpretation of the string. Note that on Unicode systems it is possible to use a string containing wide-character values. In this case the results of any encoding other than 'Native' are undefined.

Property Inventory (Including Private)

Method Inventory (Including Private)

Properties (Including Private)

property %TranslationTable as %String (TRUNCATE = 1) [ ReadOnly ];
cached value of the encoding translation table derived from CharEncoding
Property methods: %TranslationTableDisplayToLogical(), %TranslationTableGet(), %TranslationTableIsValid(), %TranslationTableLogicalToDisplay(), %TranslationTableLogicalToOdbc(), %TranslationTableNormalize()
property CharEncoding as %String (TRUNCATE = 1) [ InitialExpression = "Native" ];
Names the character encoding used to encode this character stream in its storage or transport format A value of "Native" in this property means the stream is encoded in the native format for the local installation, with no translation done. Values of "RawBytes" or "Binary" mean that each character is represented by the corresponding byte in the external storage or transport format. (This property is overridden from %IO.IParts.ByteIO but has a different meaning in this character IO context.)
Property methods: CharEncodingDisplayToLogical(), CharEncodingGet(), CharEncodingIsValid(), CharEncodingLogicalToDisplay(), CharEncodingLogicalToOdbc(), CharEncodingNormalize(), CharEncodingSet()
property Data as %String (TRUNCATE = 1) [ ReadOnly ];
Underlying encoded string data
Property methods: DataDisplayToLogical(), DataGet(), DataIsValid(), DataLogicalToDisplay(), DataLogicalToOdbc(), DataNormalize()
property charposmap [ Private , MultiDimensional ];
Map of byte positions to character positions
Property methods: charposmapDisplayToLogical(), charposmapGet(), charposmapIsValid(), charposmapLogicalToDisplay(), charposmapLogicalToOdbc(), charposmapNormalize(), charposmapSet()

Methods (Including Private)

private method %OnNew(initvalue As %String) as %Status
Inherited description: This callback method is invoked by the %New() method to provide notification that a new instance of an object is being created.

If this method returns an error then the object will not be created.

It is passed the arguments provided in the %New call. When customizing this method, override the arguments with whatever variables and types you expect to receive from %New(). For example, if you're going to call %New, passing 2 arguments, %OnNew's signature could be:

Method %OnNew(dob as %Date = "", name as %Name = "") as %Status If instead of returning a %Status code this returns an oref and this oref is a subclass of the current class then this oref will be the one returned to the caller of %New method.

method CharEncodingSet(pCharEncoding As %String) as %Status
method ExternalByteSeek(pBytePos As %Integer, Output pSC As %Status) as %Boolean
method ExternalByteSizeGet() as %Integer
method ExternalByteTruncateAt(pBytePos As %Integer, Output pSC As %Status) as %Boolean
method Read(pMaxReadLen As %Integer, ByRef pTimeout As %Numeric, Output pSC As %Status) as %String
Inherited description: Read until pMaxReadLen chars are gotten or pTimeout expires On return, if pTimeout is unchanged it means the full timeout period expired. If the timeout period expired and the returned string is shorter than pMaxReadLen, then AtEnd will be 1.
method ReadLine(pMaxReadLen As %Integer, ByRef pTimeout As %Numeric, Output pSC As %Status, ByRef pLineTerminator As %String = ..LineTerminator) as %String
Inherited description: Read until pMaxReadLen chars are gotten, pTimeout expires, or a LineTerminator character is found. On return, if pTimeout=0 it means no timeout occurred. If pTimeout=0 and the returned string contains the full pMaxReadLen characters, it means no LineTerminator was encountered yet, even if the following character would be a LineTerminator. If pTimeout=0 and the returned string is shorter than pMaxReadLen, then either a LineTerminator or the End Of Stream (AtEnd = 1) was encountered. If pLineTerminator is defined, then the line is read until one of the given characters is encountered. On return, pLineTerminator contains the encountered character(s) if any.
method Seek(pPosition As %Integer = 1, Output pSC As %Status) as %Boolean
method SizeGet() as %Integer
Return the current character size of the data stream.
method TruncateAt(pPosition As %Integer, Output pSC As %Status) as %Boolean
method Write(pData As %String = "", pFlush As %Boolean, Output pSC As %Status)
Inherited description: Write pData to the stream buffer. If pFlush is True, ensure that the data are actually sent to the stream.

Inherited Members

Inherited Properties (Including Private)

Inherited Methods (Including Private)

FeedbackOpens in a new window