sparksee.TextStream Class Reference

TextStream class. More...

List of all members.

Public Member Functions

def read
 Read data from the stream.
def is_null
 Returns TRUE if the stream is not available.
def write
 Write data to the stream.
def __init__
 Creates a new instance.
def close
 Closes the stream.


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.

Author:
Sparsity Technologies http://www.sparsity-technologies.com

Member Function Documentation

def sparksee.TextStream.read (   self,
  length 
)

Read data from the stream.

Parameters:
length [in] Length of the given data buffer. It must be > 0.
Returns:
The read data.

def sparksee.TextStream.is_null (   self  ) 

Returns TRUE if the stream is not available.

It returns for reading or writing data.

Returns:
FALSE if the stream is ready

def sparksee.TextStream.write (   self,
  dataIN,
  length 
)

Write data to the stream.

Parameters:
dataIN The string to write data from.
length Number of characters to write. It must be > 0.

def sparksee.TextStream.__init__ (   self,
  append 
)

Creates a new instance.

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

Parameters:
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.

def sparksee.TextStream.close (   self  ) 

Closes the stream.

Once the Stream is closed, it cannot be used again.


Generated on Fri Feb 7 13:22:23 2014 for SparkseePython by  doxygen 1.5.6