~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/serialize/binlog_reader.cc

  • Committer: Brian Aker
  • Date: 2008-09-04 19:31:00 UTC
  • Revision ID: brian@tangent.org-20080904193100-l849hgghfy4urj43
Changing default character set from this point on.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <config.h>
2
 
 
3
1
#include "binary_log.h"
4
2
 
5
3
#include <iostream>
6
 
#include <fstream>
7
4
 
8
5
#include <google/protobuf/io/coded_stream.h>
9
6
#include <google/protobuf/io/zero_copy_stream_impl.h>
65
62
  if (optind > argc)
66
63
    print_usage_and_exit(argv[0]);
67
64
 
68
 
  filebuf fb;
69
 
 
70
 
  fb.open(file_name, std::ios::in);
71
 
  istream is(&fb);
72
 
 
73
 
  ZeroCopyInputStream* raw_input = new IstreamInputStream(&is);
 
65
  int fd = open(file_name, O_RDONLY);
 
66
  ZeroCopyInputStream* raw_input = new FileInputStream(fd);
74
67
  CodedInputStream *coded_input = new CodedInputStream(raw_input);
75
68
 
76
69
  BinaryLog::Event event;
79
72
 
80
73
  delete coded_input;
81
74
  delete raw_input;
82
 
  fb.close();
 
75
  close(fd);
83
76
}