~skinny.moey/drizzle/innodb-replication

« back to all changes in this revision

Viewing changes to client/linebuffer.h

  • Committer: Brian Aker
  • Date: 2010-11-08 22:35:57 UTC
  • mfrom: (1802.1.114 trunk)
  • Revision ID: brian@tangent.org-20101108223557-w3xzwp9hjjtjhtc1
MergeĀ inĀ trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
 
14
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
15
15
 
16
16
#ifndef CLIENT_LINEBUFFER_H
17
17
#define CLIENT_LINEBUFFER_H
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 */