Module xmlsec :: Class Buffer
[frames | no frames]

Class Buffer


Method Summary
  __init__(self, size, _obj)
Creates and initalizes new memory buffer with given size.
  __getattr__(self, name)
  __setattr__(self, name, value)
  append(self, data, size)
Appends the data after the current data stored in the buffer.
  base64NodeContentRead(self, node)
Reads the content of the node, base64 decodes it and stores the result in the buffer.
  base64NodeContentWrite(self, node, columns)
Sets the content of the node to the base64 encoded buffer data.
  createOutputBuffer(self)
Creates new LibXML output buffer to store data in the buf.
  destroy(self)
Destroys buffer object.
  empty(self)
Empties the buffer.
  finalize(self)
Frees allocated resource for a buffer intialized with initialize method.
  getData(self)
Gets buffer's data.
  getMaxSize(self)
Gets the maximum (allocated) buffer size.
  getSize(self)
Gets the current buffer data size.
  initialize(self, size)
Initializes buffer object buf.
  prepend(self, data, size)
Prepends the data before the current data stored in the buffer.
  readFile(self, filename)
Reads the content of the file filename in the buffer.
  removeHead(self, size)
Removes size bytes from the beginning of the current buffer.
  removeTail(self, size)
Removes size bytes from the end of current buffer.
  setData(self, data, size)
Sets the value of the buffer to data.
  setMaxSize(self, size)
Sets new buffer maximum size.
  setSize(self, size)
Sets new buffer data size.

Method Details

__init__(self, size=None, _obj=None)
(Constructor)

Creates and initalizes new memory buffer with given size. Caller is
responsible for calling destroy method to free the buffer.
size    : the initial buffer size.
Returns : the buffer or None if an error occurs.

append(self, data, size)

Appends the data after the current data stored in the buffer.
data    : the data.
size    : the data size.
Returns : 0 on success or a negative value if an error occurs.

base64NodeContentRead(self, node)

Reads the content of the node, base64 decodes it and stores the result
in the buffer.
node    : the node.
Returns : 0 on success or a negative value if an error occurs.

base64NodeContentWrite(self, node, columns)

Sets the content of the node to the base64 encoded buffer data.
node    : the node.
columns : the max line size for base64 encoded data.
Returns : 0 on success or a negative value if an error occurs.

createOutputBuffer(self)

Creates new LibXML output buffer to store data in the buf. Caller is
responsible for destroying buf when processing is done.
Returns : newly allocated output buffer or None if an error occurs.

destroy(self)

Destroys buffer object.

empty(self)

Empties the buffer.

finalize(self)

Frees allocated resource for a buffer intialized with initialize method.

getData(self)

Gets buffer's data.
Returns : buffer's data.

getMaxSize(self)

Gets the maximum (allocated) buffer size.
Returns : the maximum (allocated) buffer size.

getSize(self)

Gets the current buffer data size.
Returns : the current data size.

initialize(self, size)

Initializes buffer object buf. Caller is responsible for calling
finalize method to free allocated resources.
size    : the initial buffer size.
Returns : 0 on success or a negative value if an error occurs.

prepend(self, data, size)

Prepends the data before the current data stored in the buffer.
data    : the data.
size    : the data size.
Returns : 0 on success or a negative value if an error occurs.

readFile(self, filename)

Reads the content of the file filename in the buffer.
filename : the filename.
Returns  : 0 on success or a negative value if an error occurs.

removeHead(self, size)

Removes size bytes from the beginning of the current buffer.
size    : the number of bytes to be removed.
Returns : 0 on success or a negative value if an error occurs.

removeTail(self, size)

Removes size bytes from the end of current buffer.
size    : the number of bytes to be removed.
Returns : 0 on success or a negative value if an error occurs.

setData(self, data, size)

Sets the value of the buffer to data.
data    : the data.
size    : the data size.
Returns : 0 on success or a negative value if an error occurs.

setMaxSize(self, size)

Sets new buffer maximum size. If necessary, buffer grows to have at
least size bytes.
size    : the new maximum size.
Returns : 0 on success or a negative value if an error occurs.

setSize(self, size)

Sets new buffer data size. If necessary, buffer grows to have at least
size bytes.
size    : the new data size.
Returns : 0 on success or a negative value if an error occurs.

Generated by Epydoc 2.0 on Mon Feb 9 01:09:33 2004 http://epydoc.sf.net