📄 inputsrc.h
字号:
// inputsrc.h// generic interface for a streaming input source// copyright SafeTP Development Group, Inc., 2000 Terms of use are as specified in license.txt// 6/7/99: added an output counterpart#ifndef __INPUTSRC_H#define __INPUTSRC_H#include "typ.h" // boolclass StreamInputSource {public: // (blocking) read from 1 to 'buflen' bytes, storing them in 'buffer' // and returning the # of bytes read; return 0 on graceful // EOF and throw an exception on failure virtual int read(char *buffer, int buflen)=0; // nonblocking poll for availability of data or input source closure; // returns true for data ready, false for nothing ready; // default implementation assumes the stream isn't a communications // mechanism, and therefore it never makes sense to wait for additional // information (which is what poll()==false would mean) virtual bool poll() { return true; }};class StreamOutputDest {public: // (blocking) write all 'len' bytes virtual void write(char const *data, int len)=0;};#endif // __INPUTSRC_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -