1
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
* vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
4
* Copyright (C) 2010 David Shrewsbury <shrewsbury.dave@gmail.com>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; version 2 of the License.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22
* Declaration of a class used to read the GPB messages written
23
* by transaction_writer.
29
#include <google/protobuf/io/zero_copy_stream_impl.h>
30
#include <drizzled/message/transaction.pb.h>
32
class TransactionFileReader
35
TransactionFileReader();
36
~TransactionFileReader();
39
* Open the given transaction log file.
41
* @param filename Name of the file to open
42
* @param start_pos Position within the file to begin reading
44
* @retval true Success
45
* @retval false Failure
47
bool openFile(const std::string &filename, int start_pos = 0);
50
* Read in next Transaction message and checksum.
52
* @note Error message will be "EOF" when end-of-file is reached.
54
* @param transaction Storage for the Transaction message
55
* @param checksum Storage for the checksum value
57
* @retval true Success
58
* @retval false Failure or EOF
60
bool getNextTransaction(drizzled::message::Transaction &transaction,
64
* Perform a checksum of the last read transaction message.
66
uint32_t checksumLastReadTransaction();
69
* Get the error message from the last failed operation.
71
std::string getErrorString()
80
uint32_t previous_length;
82
google::protobuf::io::ZeroCopyInputStream *raw_input;