Skip to main content

%Atelier.v2.Utils.TextServices

Class %Atelier.v2.Utils.TextServices Extends %RegisteredObject

This class provides the external interface for retrieving, storing, and compiling documents representing classes, routines, and include files (amongst others).

Methods

GetTextAsArray

ClassMethod GetTextAsArray(pFullName As %String, pFlags As %Integer = 0, Output pTextArray As %String, pBinary As %Boolean = 0) As %Status

Given a name, return an array of strings representing the document. On success the returned pTextArray will have the 0 subscript set to the number of lines and the subscripts 1-n will contain the actual text.
Or, if the pBinary flag is set, the returned pTextArray will contain chunks of Base64-encoded data and the node pTextArray("bin") will be set to 1.
The pFlags parameter contains bit flags defined as:
Source format: 0 = UDL, 1 = XML, 2 = %RO
Class storage section only: 8
Split method arguments one per line: 16

SetTextFromArray

ClassMethod SetTextFromArray(ByRef pDocumentArray As %String, pFlags As %Integer = 0, pDocName As %String, pCategory As %String, pBinary As %Boolean = 0, Output pKeywords) As %Status [ Internal ]

This method requires an integer subscripted array containing lines of text which represent an InterSystems IRIS source document (class, include, routine, etc). array(0) should contain a count of lines of text which are defined as array(1) ... array(n).
The method will parse the representation and if it is syntactically valid will attempt to save the resultant document. It returns $$$OK on success and a (possibly composite) error status on failure. Note: a syntactically valid represention may fail to save due to failure to obtain a lock.
It is important to realize that this method will replace the existing document if present and therefore must contain a full representation of the document. Also note that the name of the document and its type will be derived from within the text, unless pCategory is CSP or OTH.
The pFlags parameter is unused.
If pBinary is specified, the document array contains Base64-encoded chunks of data.