~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/serialize/binlog_reader.cc

  • Committer: Brian Aker
  • Date: 2008-11-03 21:00:47 UTC
  • mfrom: (520.9.5 devel)
  • Revision ID: brian@tangent.org-20081103210047-wfkeyyefrfl2vh4l
Merge from Monty

Show diffs side-by-side

added added

removed removed

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