inputsrc.h
来自「伯克利做的SFTP安全文件传输协议」· C头文件 代码 · 共 36 行
H
36 行
// 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 + =
减小字号Ctrl + -
显示快捷键?