Sparksee  5.2.0
STSTextStream Class Reference

TextStream class. More...

Inheritance diagram for STSTextStream:
Inheritance graph
Collaboration diagram for STSTextStream:
Collaboration graph

Instance Methods

(id) - initWithAppend:
 Creates a new instance.
(BOOL) - IsNull
 Returns TRUE if the stream is not available.
(void) - writeString:
 Write data to the stream.
(NSString *) - readString:
 Read data from the stream.
(void) - close
 Closes the TextStream instance.
(BOOL) - isClosed
 Check if the TextStream instance is closed.

Detailed Description

TextStream class.

It allows for reading and writting Text attribute values.

It is very important to close the stream once no more reading or writting operations will be performed to ensure data is successfully stored.

Whereas string attributes are set and got using the Value class, text attributes are operated using a stream pattern.

Use of TextStream for writing: (i) Create a TextStream instance and (ii) set the stream for a text attribute of a node or edge instance with the graph SetAttributeText method. Once the set attribute text has been done, (iii) perform as many write operations as you need to the TextStream instance. Lastly, (iv) exeucte Close to flush and close the stream.

Use of TextStream for reading: (i) Get the stream of a text attribute of a node or edge instance with the GetAttributeText graph method. Once you have the TextStream instance, (ii) you can execute Read operations to read from the stream. (iii) The end of the stream is reached when Read returns 0. Finally, (iv) execute Close to close stream resources.

Check out the 'Attributes and values' section in the SPARKSEE User Manual for more details on this.

Sparsity Technologies

Method Documentation

- (void) close

Closes the TextStream instance.

It must be called to ensure the integrity of all data.

- (id) initWithAppend: (BOOL)  append

Creates a new instance.

A TextStream only can be created by the user to write data.

append[in] If TRUE, the it is created in append mode to write from the end of the stream, otherwise it is created to write from the begining of the stream.
- (BOOL) IsNull

Returns TRUE if the stream is not available.

It returns for reading or writing data.

FALSE if the stream is ready
- (NSString*) readString: (int)  length

Read data from the stream.

Reads a certain amount of characters (<= length). If the result string is empty, there is no more data to be read from the stream.

length[in] Maximum length to be read. It must be > 0.
Returns the string readed.
- (void) writeString: (NSString *)  inStr

Write data to the stream.

inStr[in] The source string.

The documentation for this class was generated from the following file: