Allows the manipulation of globus_byte_t arrays. This class malloc's the
underlying memory in the constructor, and free's it during destruction. It
supports returning the underlying memory as a python string. It also supports
the readline and readlines methods.
Methods
|
|
__del__
__init__
__len__
as_string
get_handle
get_size
readline
readlines
set_handle
|
|
__del__
|
__del__ ( self )
Destroys the Buffer object.
Free's the underlying memory.
|
|
__init__
|
__init__ ( self, size )
Contruct a Buffer object.
This methods causes underlying memory to be malloc'd.
Arguments:
size The size of the buffer to create.
Raises:
A GlobusBufferException is thrown if unable to create
the buffer object.
|
|
__len__
|
__len__ ( self )
Get the size of the Buffer object.
Returns:
An int containing the size of the Buffer object.
|
|
as_string
|
as_string ( self, size )
Convert the underlying globus_byte_t array into a Python string.
Arguments:
size The number of bytes to convert.
Returns:
A string containg the contents of the Buffer.
|
|
get_handle
|
get_handle ( self )
Get the underlying pointer to the globus_byte_t array.
Returns:
A SWIG'ized pointer to the underlying byte array.
XXX This handle is only valid as long as this object exists. When
the object is destroyed, the memory this handle points to is freed.
|
|
get_size
|
get_size ( self )
Get the size of the Buffer object.
Returns:
An int containing the size of the Buffer object.
|
|
readline
|
readline ( self )
Return a single line as a string.
Returns:
A string containing the next line in the Buffer.
|
|
readlines
|
readlines ( self )
Return a list containing each line in the Buffer.
Returns:
A list of strings containing each line in the Buffer.
|
|
set_handle
|
set_handle ( self, handle )
Sets a globus_byte_t array to a Buffer object
|