diff options
Diffstat (limited to 'lib/common/FdGetLine.h')
-rw-r--r-- | lib/common/FdGetLine.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/common/FdGetLine.h b/lib/common/FdGetLine.h index df43c3c9..6b609fe8 100644 --- a/lib/common/FdGetLine.h +++ b/lib/common/FdGetLine.h @@ -12,6 +12,7 @@ #include <string> +<<<<<<< HEAD #ifdef BOX_RELEASE_BUILD #define FDGETLINE_BUFFER_SIZE 1024 #elif defined WIN32 @@ -25,6 +26,9 @@ // Just a very large upper bound for line size to avoid // people sending lots of data over sockets and causing memory problems. #define FDGETLINE_MAX_LINE_SIZE (1024*256) +======= +#include "GetLine.h" +>>>>>>> 0.12 // -------------------------------------------------------------------------- // @@ -34,15 +38,24 @@ // Created: 2003/07/24 // // -------------------------------------------------------------------------- +<<<<<<< HEAD class FdGetLine { public: FdGetLine(int fd); ~FdGetLine(); +======= +class FdGetLine : public GetLine +{ +public: + FdGetLine(int fd); + virtual ~FdGetLine(); +>>>>>>> 0.12 private: FdGetLine(const FdGetLine &rToCopy); public: +<<<<<<< HEAD std::string GetLine(bool Preprocess = false); bool IsEOF() {return mEOF;} int GetLineNumber() {return mLineNumber;} @@ -59,6 +72,21 @@ private: int mBytesInBuffer; bool mPendingEOF; bool mEOF; +======= + virtual std::string GetLine(bool Preprocess = false); + // Call to detach, setting file pointer correctly to last bit read. + // Only works for lseek-able file descriptors. + void DetachFile(); + // if we read 0 bytes from an fd, it must be end of stream, + // because we don't support timeouts + virtual bool IsStreamDataLeft() { return false; } + +protected: + int ReadMore(int Timeout = IOStream::TimeOutInfinite); + +private: + int mFileHandle; +>>>>>>> 0.12 }; #endif // FDGETLINE__H |