~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/linebuffer.h

  • Committer: Lee Bieber
  • Date: 2010-11-08 02:12:25 UTC
  • mfrom: (1912.1.2 build)
  • Revision ID: kalebral@gmail.com-20101108021225-7vfdp6cn81b8i1cx
Merge Brian - Cleanup counter_thread for slap, and remove the need to track the count of threads by doing a join to harvest.
Merge Andrew - fix bug 653240: drizzle command line client reads copious amounts of data into RAM before sending commands 
Merge Andrew - fix bug 672074: buffer overrun in LineBuffer

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 
19
19
#include <vector>
20
20
#include <sstream>
 
21
#include <iostream>
 
22
#include <boost/iostreams/stream.hpp>
 
23
#include <boost/iostreams/device/file_descriptor.hpp>
21
24
 
22
25
class LineBuffer
23
26
{
24
27
public:
25
28
  LineBuffer(uint32_t max_size,FILE *file);
26
 
 
27
29
  void addString(const std::string &argument);
28
30
  char *readline();
29
31
private:
30
32
  FILE *file;
31
 
  std::stringstream buffer;
32
33
  std::vector<char> line;
 
34
  std::iostream *file_stream;
33
35
  uint32_t max_size;
34
 
  bool eof;
35
36
};
36
37
 
37
38
#endif /* CLIENT_LINEBUFFER_H */