ERUCES::TECipherStream
#include <tecipher.h>
The TECipherStream class is an abstract interface for cryptographic stream operations.
The TECipherStream class is used to manage cryptopraphic operations in data stream.
Private Attrib
| Type | Name | Description |
|---|---|---|
| TECipher & | cipher_ | |
| std::istream * | is_ | |
| std::ostream * | os_ |
Public Member Functions
| Member | Description |
|---|---|
TECipherStream(TECipher &cipher, std::istream *is=0, std::ostream *os=0) | constructor |
void istream(std::istream *is) | The istream methos sets the input stream. |
std::istream * istream() | The istream methos retrieves the input stream. |
void ostream(std::ostream *os) | The ostream method sets the output stream. |
std::ostream * ostream() | The ostream method gets the output stream. |
void read(Data &buf) | The read method read data from input stream and update cipher, if EOF is reached cipher is finished. |
void write(const Data &buf) | The write method processes and writes data into output stream. |
void flush() | The flush method finishes the cipher and flushes the output stream. |
std::streamsize run(std::streamsize bufsize=BUFSIZ) | The run method takes an input stream through cipher into output stream. |
Private Func
| Member | Description |
|---|---|
void read_(Data &buf) | |
void write_(const Data &buf) | |
void flush_() |
Member Function Documentation
TECipherStream(TECipher &cipher, std::istream *is=0, std::ostream *os=0)
constructor
Parameters
| Parameter | Description |
|---|---|
cipher | - instance of TECipher |
is | - input stream |
os | - output stream |
void istream(std::istream *is)
The istream methos sets the input stream.
std::istream * istream()
The istream methos retrieves the input stream.
void ostream(std::ostream *os)
The ostream method sets the output stream.
std::ostream * ostream()
The ostream method gets the output stream.
void read(Data &buf)
The read method read data from input stream and update cipher, if EOF is reached cipher is finished.
read data from input stream and update cipher, if EOF is reached cipher is finished
Parameters
| Parameter | Description |
|---|---|
buf | buffer for input data, set size to expected amount of data |
void write(const Data &buf)
The write method processes and writes data into output stream.
Parameters
| Parameter | Description |
|---|---|
buf | output data |
void flush()
The flush method finishes the cipher and flushes the output stream.
std::streamsize run(std::streamsize bufsize=BUFSIZ)
The run method takes an input stream through cipher into output stream.
Parameters
| Parameter | Description |
|---|---|
bufsize | - internal buffer size for read operation |
Returns: total bytes processed