15using namespace ::
Binc;
18IODevice::IODevice(
int f) : flags(f | IsEnabled),
19 maxInputBufferSize(0),
20 maxOutputBufferSize(0),
22 readCount(0), writeCount(0),
23 outputLevel(ErrorLevel),
24 outputLevelLimit(ErrorLevel),
25 error(Unknown), errorString(
"Unknown device error"),
41 static std::ostream &(*endl_funcptr)(ostream &) = endl;
43 if (source != endl_funcptr)
return *
this;
83 writeResult =
write();
125 flags &= ~HasTimeout;
277 ss <<
"/tmp/bincimap-dump-" << (int) time(0) <<
"-"
279 char *safename = strdup(ss.
str().c_str());
280 dumpfd = mkstemp(safename);
void unpopStr(const std::string &s)
const std::string & str(void) const
std::string popString(unsigned int size)
unsigned int getSize(void) const
The IODevice class provides a framework for reading and writing to device.
virtual bool waitForRead(void) const
void setMaxOutputBufferSize(unsigned int max)
void setFlags(unsigned int f)
bool readStr(std::string *dest, unsigned int max=0)
virtual bool waitForWrite(void) const
void setTimeout(unsigned int t)
virtual WriteResult write(void)
bool readChar(char *dest=0)
void clearFlags(unsigned int f)
void enableProtocolDumping(void)
IODevice & operator<<(const T &source)
virtual std::string service(void) const
virtual bool fillInputBuffer(void)
void setMaxInputBufferSize(unsigned int max)
LogLevel getOutputLevel(void) const
virtual bool canRead(void) const
Error getLastError(void) const
LogLevel getOutputLevelLimit(void) const
unsigned int maxOutputBufferSize
unsigned int maxInputBufferSize
unsigned int getReadCount(void) const
void setOutputLevel(LogLevel level)
void unreadStr(const std::string &s)
LogLevel outputLevelLimit
unsigned int getTimeout(void) const
unsigned int getWriteCount(void) const
std::string getLastErrorString(void) const
void setOutputLevelLimit(LogLevel level)
const std::string & getIP(void) const
static Session & getInstance(void)
Declaration of miscellaneous convertion functions.
Declaration of the IODevice class.