diff options
Diffstat (limited to 'lib/common/IOStreamGetLine.h')
-rw-r--r-- | lib/common/IOStreamGetLine.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/common/IOStreamGetLine.h b/lib/common/IOStreamGetLine.h index c4289073..1b537031 100644 --- a/lib/common/IOStreamGetLine.h +++ b/lib/common/IOStreamGetLine.h @@ -33,16 +33,22 @@ private: public: bool GetLine(std::string &rOutput, bool Preprocess = false, int Timeout = IOStream::TimeOutInfinite); - + std::string GetLine() + { + std::string output; + GetLine(output); + return output; + } + // Call to detach, setting file pointer correctly to last bit read. // Only works for lseek-able file descriptors. void DetachFile(); - + virtual bool IsStreamDataLeft() { return mrStream.StreamDataLeft(); } - + // For doing interesting stuff with the remaining data... // Be careful with this! const void *GetBufferedData() const {return mBuffer + mBufferBegin;} @@ -52,7 +58,7 @@ public: protected: int ReadMore(int Timeout = IOStream::TimeOutInfinite); - + private: IOStream &mrStream; }; |