IRISLIB database
DynamicCharacter Class Reference

<class>Stream.DynamicCharacter</class> character stream containing the textual value of an element of a <class>DynamicAbstractObject</class>. More...

Inheritance diagram for DynamicCharacter:
Collaboration diagram for DynamicCharacter:

Public Member Functions

_.Library.Status OnClose ()
 This callback method is invoked by the <METHOD>Close</METHOD> method to. More...
 
_.Library.Status OnRollBack ()
 This callback method is invoked by the <METHOD>Save</METHOD> method to. More...
 
_.Library.Status Clear (_.Library.Boolean permanent)
 
_.Library.Status CopyFrom (_.Stream.Object source)
 
_.Library.Status Flush ()
 Flush any output in the stream not already saved.
 
_.Library.Boolean IsNull ()
 Returns true if this is a "NULL" stream; that is, a stream which has never. More...
 
_.Library.Boolean MoveTo (_.Library.Integer position)
 Move to this position in the stream. More...
 
_.Library.Status MoveToEnd ()
 
_.Library.Status OutputToDevice (_.Library.Integer len)
 Write out len characters of the stream to the current device. More...
 
_.Library.Integer PositionGet ()
 Implements Property <property>Position</property> More...
 
_.Library.String Read (_.Library.Integer len, _.Library.Status sc)
 Reads up to len characters from the current position. More...
 
_.Library.String ReadLine (_.Library.Integer len, _.Library.Status sc, _.Library.Boolean eol)
 Read a line from the stream. More...
 
_.Stream.Object ReadLineIntoStream (_.Library.Status sc)
 This reads from the stream until it finds the. More...
 
_.Library.Status Rewind ()
 Go back to the start of the stream.
 
_.Library.Integer SizeGet ()
 Implements Property <property>Size</property> More...
 
_.Library.Status Write (_.Library.String data)
 
_.Library.Status WriteLine (_.Library.String data)
 
- Public Member Functions inherited from Object
_.Library.Status AcquireLock (locktype)
 Acquires a lock for the current instance. More...
 
_.Library.Status OnAfterSave (_.Library.Boolean insert)
 This callback method is invoked by the <METHOD>Save</METHOD> method to. More...
 
_.Library.Status OnBeforeSave (_.Library.Boolean insert)
 This callback method is invoked by the <METHOD>Save</METHOD> method to. More...
 
_.Library.Status OnOpen ()
 This callback method is invoked by the <METHOD>Open</METHOD> method to. More...
 
_.Library.Status OnReload ()
 This callback method is invoked by the <METHOD>Reload</METHOD> method to. More...
 
_.Library.Status Clear ()
 Clear the contents of this Stream from permanent storage. More...
 
_.Library.Status CopyFromAndSave (_.Stream.Object source)
 Copy the stream from source into the current stream ignoring anything already in the current stream. More...
 
_.Library.Integer FindAt (_.Library.Integer position, _.Library.RawString target, _.Library.RawString tmpstr, _.Library.Boolean caseinsensitive)
 Find the first occurrence of target in the stream, starting the search at position. More...
 
_.Library.String GetStreamId ()
 Returns an full id value (including class name) with which the Stream implementation has stored. More...
 
_.Library.Status InputFromDevice (_.Library.Integer len, _.Library.Integer timeout)
 Input len characters from the current device into the stream. More...
 
_.Library.Status OutputToDeviceAt (_.Library.Integer position, _.Library.Integer length)
 Output the stream to the current device starting at position of length. More...
 
_.Library.String ReadSQL (_.Library.Integer start, _.Library.Integer end)
 SQL specific method for reading stream data.
 
_.Library.Status SerializeToSyncSet (_.SYNC.SyncSet ss, _.Library.Integer iPtr, _.Library.String property)
 SerializeToSyncSet copies the stream value from the current object to the sync set global. More...
 
_.Library.Status SyncStreamIn (_.SYNC.SyncSet ss, _.Library.Integer iPtr, _.Library.String property)
 SyncStreamIn copies the stream value from the sync set global into the current object.
 
_.Library.Status Write (_.Library.RawString data)
 Appends the string data to the stream and advances the. More...
 
_.Library.Status WriteLine (_.Library.RawString data)
 Appends the string data along with a line terminator to the stream and advances the. More...
 
- Public Member Functions inherited from RegisteredObject
_.Library.Status OnAddToSaveSet (_.Library.Integer depth, _.Library.Integer insert, _.Library.Integer callcount)
 This callback method is invoked when the current object is added to the SaveSet,. More...
 
_.Library.Status OnConstructClone (_.Library.RegisteredObject object, _.Library.Boolean deep, _.Library.String cloned)
 This callback method is invoked by the <METHOD>ConstructClone</METHOD> method to. More...
 
_.Library.Status OnNew ()
 This callback method is invoked by the <METHOD>New</METHOD> method to. More...
 
_.Library.Status OnValidateObject ()
 This callback method is invoked by the <METHOD>ValidateObject</METHOD> method to. More...
 

Static Public Member Functions

_.Library.String GetLockReference (_.Library.String pLocation, _.Library.String pId)
 Returns the global reference used to lock the current stream object.
 
- Static Public Member Functions inherited from Object
_.Library.Status OnDelete (_.Library.ObjectIdentity oid)
 This callback method is invoked by the <METHOD>Delete</METHOD> method to. More...
 
_.Library.String IsCharacter ()
 Return true if this is a character stream and false if it is a binary stream.
 
_.Library.Boolean StreamOIDIsNull (_.Library.ObjectIdentity soid)
 Return true if this stream oid is a null stream and false if the stream is not null.
 

Public Attributes

 LineTerminator
 The line terminator we use for this stream. More...
 
 Position
 <property>Position</property> is a read-only property containing the More...
 
 Size
 <property>Size</property> is a read-only property containing the More...
 
- Public Attributes inherited from Object
 AtEnd
 The AtEnd property is set to true (1) when, during a read,. More...
 
 Id
 Id is the unique identifier for a stream within the Location. More...
 
 LastModified
 LastModified is a read-only property containing the <class>TimeStamp</class> of More...
 
 Size
 Size is a read-only property containing the current size of the stream (in bytes More...
 

Static Public Attributes

 BUFLEN = None
 <class>Stream.DynamicCharacter</class> character stream containing the textual value of an element of a <class>DynamicAbstractObject</class>. More...
 
 READLEN = None
 Default length for a Read.
 
- Static Public Attributes inherited from Object
 DEFAULTCONCURRENCY = None
 
- Static Public Attributes inherited from RegisteredObject
 CAPTION = None
 Optional name used by the Form Wizard for a class when generating forms. More...
 
 JAVATYPE = None
 The Java type to be used when exported.
 
 PROPERTYVALIDATION = None
 This parameter controls the default validation behavior for the object. More...
 

Private Member Functions

_.Library.Integer IsModified ()
 Returns true (1) if a property of this instance has been modified, otherwise false (0). More...
 
_.Library.Boolean IsNull ()
 Returns true if this is a "NULL" stream; that is, a stream which has never. More...
 
_.Library.Status NormalizeObject ()
 Normalizes all of an object's property values by invoking the data type Normalize methods. More...
 
_.Library.Integer ObjectModified ()
 This method is somewhat similar to IsModified but it also checks to see if swizzled. More...
 
_.Library.Status __BuildValueArray (_.Library.String subvalue)
 Callback for searchable stream.
 

Private Attributes

 __DAOPos
   More...
 
 __DAOSize
   More...
 

Detailed Description

<class>Stream.DynamicCharacter</class> character stream containing the textual value of an element of a <class>DynamicAbstractObject</class>.

It is particularly useful for holding the value of a <class>DynamicAbstractObject</class> element with a textual value that would exceed the capacity of an ObjectScript string variable. A <class>Stream.DynamicCharacter</class> object is readonly and it cannot be modified or saved. But it can be copied to any other Stream class object that does support modification and saving.

One way to create a <class>Stream.DynamicCharacter</class> is by making a method call that looks like dao.Get(key,default,"stream") where dao is an object reference to a subclass of <class>DynamicAbstractObject</class>; and where key is the key name value of an element of a <class>DynamicObject</class> or the index value of an element of a <class>DynamicArray</class>. You can also get a <class>Stream.DynamicCharacter</class> object by calling the <method class="%Iterator.AbstractIterator">GetNext</method>(.key,.value,.type) method in one of subclasses of the <class>Iterator.AbstractIterator</class> class. is by making a method call that

Member Function Documentation

◆ IsModified()

_.Library.Integer IsModified ( )
private

Returns true (1) if a property of this instance has been modified, otherwise false (0).

A TRUE result does not necessarily mean that any property has actually been changed. If IsModified() returns false then the object has not been modified. There are some situations where we simply cannot efficiently detect a change in value. In these cases we will set the modified status of the property.

Reimplemented from RegisteredObject.

◆ IsNull() [1/2]

_.Library.Boolean IsNull ( )
private

Returns true if this is a "NULL" stream; that is, a stream which has never.

been written to and saved. This is used by the InterSystems IRIS ODBC server. But a <class>Stream.DynamicCharacter</class> is never NULL, even if it only contains the empty string.

Reimplemented from Object.

◆ NormalizeObject()

_.Library.Status NormalizeObject ( )
private

Normalizes all of an object's property values by invoking the data type Normalize methods.

Many data types may allow many different representations of the same value. 
Normalization converts a value to its cannonical, or <em>normalized</em>, form.

Reimplemented from RegisteredObject.

◆ ObjectModified()

_.Library.Integer ObjectModified ( )
private

This method is somewhat similar to IsModified but it also checks to see if swizzled.

references would cause the object to become modified should they be serialized. This works on the assumption that a reference to a persistent object will never be modified if the ID has already been assigned. For references to serial objects, a call to ObjectModified indicates whether or not the serialized value is different. If the reference to a swizzled object is different from the initial object state then the $$$objModAll macro will already return true. Reference the <property>Set code.

Returns true (1) if this instance has been modified, otherwise false (0).

Reimplemented from RegisteredObject.

◆ OnClose()

_.Library.Status OnClose ( )

This callback method is invoked by the <METHOD>Close</METHOD> method to.

provide notification that the current object is being closed.

The return value of this method is ignored.

Reimplemented from Object.

◆ OnRollBack()

_.Library.Status OnRollBack ( )

This callback method is invoked by the <METHOD>Save</METHOD> method to.

provide notification that a save transaction is being rolled back.

If this method returns an error then the rollback operation will be aborted.

Reimplemented from Object.

◆ Clear()

_.Library.Status Clear ( _.Library.Boolean  permanent)

Not supported. <class>Stream.DynamicCharacter</class>

is readonly.

◆ CopyFrom()

_.Library.Status CopyFrom ( _.Stream.Object  source)

Not supported. <class>Stream.DynamicCharacter</class>

is readonly.

Reimplemented from Object.

◆ IsNull() [2/2]

_.Library.Boolean IsNull ( )

Returns true if this is a "NULL" stream; that is, a stream which has never.

been written to and saved. This is used by the InterSystems IRIS ODBC server. But a <class>Stream.DynamicCharacter</class> is never NULL, even if it only contains the empty string.

Reimplemented from Object.

◆ MoveTo()

_.Library.Boolean MoveTo ( _.Library.Integer  position)

Move to this position in the stream.

If this succeeds then return

true, else return false.

<method>MoveTo</method>(1) is equivalent to a <method>Rewind</method>(). <method>MoveTo</method>(1) will always succeed and it will position the <class>Stream.DynamicCharacter</class> at character position 1 even if the <class>Stream.DynamicCharacter</class> contains no characters. Moving to position 1 (or earlier) will be at the first character of the stream; position 2 will be at the second character of the stream, etc.

Reimplemented from Object.

◆ MoveToEnd()

_.Library.Status MoveToEnd ( )

Not supported. <class>Stream.DynamicCharacter</class>

is readonly.

Reimplemented from Object.

◆ OutputToDevice()

_.Library.Status OutputToDevice ( _.Library.Integer  len)

Write out len characters of the stream to the current device.

starting from the current position. If len is omitted or set to -1 then the <method>OutputToDevice</method> method will write out the entire stream starting at the beginning and then rewind back to the beginning. If len&gt0 and we are unable to write len characters because we reach the end of the stream then we will stop writing and set the <property>AtEnd</property> property to 1. Otherwise, we will leave the stream positioned after the last character written to the device. If parameter len is passed by reference and if no error occurs then the number of characters actually written to the output device will be assigned to len. If zero characters are written because we are already positioned at the end of the stream then len will be assigned to -1. If an error occurs while writing the device then len will be assigned to -2, an error <type>Status</type> value will be returned and the stream will rollback to its original position.

Reimplemented from Object.

Reimplemented in DynamicBinary.

◆ PositionGet()

_.Library.Integer PositionGet ( )

Implements Property <property>Position</property>

which contains the current position within the data stream.

◆ Read()

Reads up to len characters from the current position.

in the stream. The current position is advanced by the number of characters read. Upon exit, len is set to the actual number of characters read. If a read occurs when the stream position is at the end of the stream, len will be set to -1 and <method>Read</method> will return a null string (""). If no len is passed in, ie. '<method>Read</method>()' then it is up to the Read implementation as to how much data to return. Some stream classes use this to optimize the amount of data returned to align this with the underlying storage of the stream.

You must call <method>Rewind</method> if you want to read a stream from the beginning again. Calling <method>Read</method> after <method>Write</method> implicitly ends the <method>Write</method> operation and rewinds to the start of the stream.

Returns a string up to len characters long. The byref argument sc will return a Status if any error occurred during the read.

Reimplemented from Object.

◆ ReadLine()

Read a line from the stream.

This will look for the line terminator in the stream and

once it finds the terminator it will return the string minus the terminator character/s. If it reaches the end of the stream before it finds a terminator it will return the data it has so far, and if you specify a maximum size in len it will only read up to this number of characters. On exit len will contain the actual number of characters read. The byref argument sc will return a <method>Status</method> if any error occured during the read and the byref argument eol is true if it found the line terminator and false otherwise. So for example you can read in a stream a line at a time and output the results to the current device with:

While 'stream.AtEnd { Write stream.ReadLine(,.sc,.eol) If $$$ISERR(sc) { Write "ERROR" Quit } If eol { Write ! } }

Reimplemented from Object.

◆ ReadLineIntoStream()

_.Stream.Object ReadLineIntoStream ( _.Library.Status  sc)

This reads from the stream until it finds the.

<property>LineTerminator</property> and returns a new <class>Stream.TmpCharacter</class> stream containing the characters in the line. If the stream does not contain the line terminator then this can potentially be the entire stream.

Reimplemented from Object.

Reimplemented in DynamicBinary.

◆ SizeGet()

_.Library.Integer SizeGet ( )

Implements Property <property>Size</property>

which contains the current size of the data stream.

Reimplemented from Object.

◆ Write()

Not supported. <class>Stream.DynamicCharacter</class>

is readonly.

◆ WriteLine()

_.Library.Status WriteLine ( _.Library.String  data)

Not supported. <class>Stream.DynamicCharacter</class>

is readonly.

Member Data Documentation

◆ BUFLEN

BUFLEN = None
static

<class>Stream.DynamicCharacter</class> character stream containing the textual value of an element of a <class>DynamicAbstractObject</class>.

It is particularly useful for holding the value of a <class>DynamicAbstractObject</class> element with a textual value that would exceed the capacity of an ObjectScript string variable. A <class>Stream.DynamicCharacter</class> object is readonly and it cannot be modified or saved. But it can be copied to any other Stream class object that does support modification and saving.

One way to create a <class>Stream.DynamicCharacter</class> is by making a method call that looks like dao.Get(key,default,"stream") where dao is an object reference to a subclass of <class>DynamicAbstractObject</class>; and where key is the key name value of an element of a <class>DynamicObject</class> or the index value of an element of a <class>DynamicArray</class>. You can also get a <class>Stream.DynamicCharacter</class> object by calling the <method class="%Iterator.AbstractIterator">GetNext</method>(.key,.value,.type) method in one of subclasses of the <class>Iterator.AbstractIterator</class> class. is by making a method call that

Default read length when buffering

◆ __DAOPos

__DAOPos
private

 

 

◆ __DAOSize

__DAOSize
private

 

 

◆ LineTerminator

LineTerminator

The line terminator we use for this stream.

It defaults to $CHAR(13,10),

CR/LF. Maximum length is 10 characters.  

◆ Position

Position

<property>Position</property> is a read-only property containing the

current character position of the <class>Stream.DynamicCharacter</class>. The next <method>Read</method>() method call will start reading at this character position. Character position 1 is the position of the first character in the stream. When Position contains the value 1 then the first <method>Read</method>() (after creation of the stream or after execution of the <method>Rewind</method>() method) has not yet been executed. After the last character has been read then Position will again contain the value 1.

 

◆ Size

Size

<property>Size</property> is a read-only property containing the

current size of the <class>Stream.DynamicCharacter</class> in characters