If true then remove the permanent global as well as any temp global when this object is closed
If you call %Save on a stream where RemoveOnClose is true it will set this to false as if you
explicitly save the stream you no longer want it to be removed when the object is closed. In order
to make sure %Save always runs the logic to reset the flag setting this to true
causes %IsModified/%ObjectModified to return true.
Inherited description: Checks to see if the object identified by the OID oid exists in the extent.
Returns %Boolean TRUE is it exists, FALSE if it does not.
private classmethod %GetLockReference(pLocation As %String(MAXLEN="")="", pId As %String(MAXLEN="")="") as %String [ Language = objectscript ]
Returns the global reference used to lock the current stream object
Throws %Exception.AbstractException
method %IsModified() as %Integer [ Language = objectscript ]
Inherited description: 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.
method %IsNull() as %Boolean [ Language = objectscript ]
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.
private method %LoadData(id As %String) as %Status [ Language = objectscript ]
private classmethod %LogicalToStorage(val As %String) as %String [ Language = objectscript ]
method %NormalizeObject() as %Status [ Language = objectscript ]
Inherited description: 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 normalized, form.
Inherited description: Return true if this stream oid is a null stream and false if the stream is not null
method %ObjectModified() as %Integer [ Language = objectscript ]
Inherited description: 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 Set code.
Returns true (1) if this instance has been modified, otherwise false (0).
private method %OnClose() as %Status [ Language = objectscript ]
Inherited description: This callback method is invoked by the %Close() method to
provide notification that the current object is being closed.
Inherited description: This callback method is invoked by the %ConstructClone() method to
provide notification that a clone of an object is being created. It passes in the
oref of the object that was cloned in object.
If this method returns an error then the object will not be created.
private method %OnNew(initval As %String = "") as %Status [ Language = objectscript ]
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.
private method %OnRollBack() as %Status [ Language = objectscript ]
Inherited description: This callback method is invoked by the %Save() 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.
private method %SaveData(ByRef sid As %String) as %Status [ Language = objectscript ]
private classmethod %StorageToLogical(val As %String) as %String [ Language = objectscript ]
Inherited description: This method validates an object. The %Save method of a persistent class calls it before filing any objects in the database.
The %ValidateObject method of a referencing object can call it. You can also call it explicitly at any time.
It tests if any required property values are missing.
If the PROPERTYVALIDATION class parameter is set to ValidateOnSave,
it validates each non-null property value by calling the property method IsValid on each literal property and the object's %ValidateObject method for object-valued properties.
If any of these tests fail, %ValidateObject() immediately returns an error value. It is up to the caller
of %ValidateObject to process the error value.
unused is not used. checkserial will force the checking of any serial properties by calling their %ValidateObject methods after swizzling
this property.
Returns a %Status value indicating success or failure.
private method BuildValueArray(ByRef subvalue As %String) as %Status [ Language = objectscript ]
Callback for searchable stream
private method CheckAtEnd() [ Language = objectscript ]
Check if we are at the end of the global, but do not read the next buffer
method Clear(permanent As %Boolean = 1) as %Status [ Language = objectscript ]
Inherited description: Clear the contents of this Stream from permanent storage. This will remove the permanent stream storage and
any temporary stream and initialise the stream to its initial state that it starts in, including removing all
the stream attributes.
Returns a %Status value indicating success or failure.
Inherited description: Copies the contents of source into this Stream.
For example, you can copy oldstream into a new stream:
Set newstream=##class(%GlobalCharacterStream).%New()
Do newstream.CopyFrom(oldstream)
Returns a %Status value indicating success or failure.
method Flush() as %Status [ Language = objectscript ]
Inherited description: Flush any output in the stream not already saved.
method IsNull() as %Boolean [ Language = objectscript ]
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.
final method LastModifiedGet() as %TimeStamp [ Language = objectscript ]
method MoveToEnd() as %Status [ Language = objectscript ]
Inherited description: Move to the end of the stream so the next Write will be appended to the end.
This allows you to read from a stream, then MoveToEnd() and append new data, where just calling
Write() after a read will clear the stream before writing new data.
Returns a %Status value indicating success or failure.
method OutputToDevice(ByRef len As %Integer = -1) as %Status [ Language = objectscript ]
Inherited description: Write out len characters of the stream to the current device starting from the current position. This
method is optimised for performance by the various sub classes. If len is omitted or set to -1 then
it will write out the entire stream starting at the beginning.
Inherited description: 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
Read() will return a null string (""). If no len
is passed in, ie. 'Read()()' 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 Rewind() if you want to read a stream from the beginning
again. Calling Read() after Write() implicitly ends the Write()
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.
private method ReadIntoBuffer() as %Boolean [ Language = objectscript ]
Reads the next node into Buffer.
Returns 0 if there is no more data.
method ReadLine(ByRef len As %Integer = 32000, ByRef sc As %Status, ByRef eol As %Boolean) as %RawString [ Language = objectscript ]
Inherited description: 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 %Status() 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 ! } }
method ReadLineIntoStream(ByRef sc As %Status) as %Stream.Object [ Language = objectscript ]
This reads from the stream until it find the LineTerminator and returns
this as a stream. If the stream does not contain the line terminator this can potentially be the
entire stream.
method Rewind() as %Status [ Language = objectscript ]
Inherited description: Go back to the start of the stream.
private method SetupTmpGbl() [ Language = objectscript ]
Setup the TempGbl location of where we will write the temp stream to
method SizeGet() as %Integer [ Language = objectscript ]
Appends the string data along with a line terminator to the stream and advances the
current stream position by the number of characters in data plus the line terminator.
Returns a %Status value indicating success or failure.