Bidirectional stream to external data.
More...
#include <ExternalDataSource.hpp>
Bidirectional stream to external data.
ca_mgm::ExternalDataSource::ExternalDataSource |
( |
FILE * |
inputfile = 0 , |
|
|
FILE * |
outputfile = 0 |
|
) |
| |
Create a new instance.
- Parameters
-
inputfile | The stream for reading |
outputfile | The stream for writing Either can be NULL if no reading/writing is allowed. |
virtual ca_mgm::ExternalDataSource::~ExternalDataSource |
( |
| ) |
|
|
virtual |
Implicitly close the connection.
virtual int ca_mgm::ExternalDataSource::close |
( |
| ) |
|
|
virtual |
FILE* ca_mgm::ExternalDataSource::inputFile |
( |
| ) |
const |
|
inline |
Return the input stream.
References inputfile.
FILE* ca_mgm::ExternalDataSource::outputFile |
( |
| ) |
const |
|
inline |
size_t ca_mgm::ExternalDataSource::receive |
( |
char * |
buffer, |
|
|
size_t |
length |
|
) |
| |
Read some data from the input stream.
- Parameters
-
buffer | Where to put the data |
length | How much to read at most Returns the amount actually received |
std::string ca_mgm::ExternalDataSource::receiveLine |
( |
| ) |
|
Read one line from the input stream. Returns the line read, including the terminator.
std::string ca_mgm::ExternalDataSource::receiveUpto |
( |
char |
c | ) |
|
Read characters into a string until character c is read. C is put at the end of the string.
bool ca_mgm::ExternalDataSource::send |
( |
const char * |
buffer, |
|
|
size_t |
length |
|
) |
| |
Send some data to the output stream.
- Parameters
-
buffer | The data to send |
length | The size of it |
bool ca_mgm::ExternalDataSource::send |
( |
std::string |
s | ) |
|
Send some data down the stream.
- Parameters
-
void ca_mgm::ExternalDataSource::setBlocking |
( |
bool |
mode | ) |
|
Set the blocking mode of the input stream.
- Parameters
-
mode | True if the reader should be blocked waiting for input. This is the initial default. |
FILE* ca_mgm::ExternalDataSource::inputfile |
|
protected |
char* ca_mgm::ExternalDataSource::linebuffer |
|
private |
size_t ca_mgm::ExternalDataSource::linebuffer_size |
|
private |
FILE* ca_mgm::ExternalDataSource::outputfile |
|
protected |
The documentation for this class was generated from the following file: