/usr/include/srecord/input/filter/message.h is in libsrecord-dev 1.58-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | //
// srecord - Manipulate EPROM load files
// Copyright (C) 2009-2011 Peter Miller
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation; either version 3 of the License, or (at
// your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
#ifndef SRECORD_INPUT_FILTER_MESSAGE_H
#define SRECORD_INPUT_FILTER_MESSAGE_H
#include <srecord/input/filter.h>
#include <srecord/memory.h>
namespace srecord
{
/**
* The srecord::input_filter_message class is used to represent an abstract
* base class for filters that must operate on the complete data, in
* order, in order to functions (e.g. CRC, message digest, etc).
*
* All of the machinery for accumulating the input data and eventually
* forwarding it on are in this common base class. The only methods
* that a derived class must supply are data block processing and
* results creation.
*/
class input_filter_message:
public input_filter
{
public:
/**
* The destructor.
*/
virtual ~input_filter_message();
protected:
/**
* The constructor.
*
* @param deeper
* The data to be filtered.
* @param naked
* Whether or not to forward the data: true means result only
* with no data, false means result and data.
*/
input_filter_message(const input::pointer &deeper, bool naked = false);
// See base class for documentation.
bool read(record &record);
/**
* The process method is used to process the data from the input.
*
* @param input
* The memory representation to be processed.
* @param output
* The filter's output.
*/
virtual void process(const memory &input, record &output) = 0;
/**
* The get_algorithm_name method is used in error messages.
*/
virtual const char *get_algorithm_name() const = 0;
private:
/**
* The naked instance variable is used to remember whether or not
* to forward the data: true means result only with no data, false
* means result and data.
*/
bool naked;
/**
* The buffer instance variable is used to remember the contents
* of the deeper file. The deeper file must be read completely
* in order to calculate the result, and the input may be out of
* address order, necessitating this buffer.
*/
memory buffer;
/**
* The buffer_pos instance variable is used to remember where we
* are up to in processing 'buffer'.
*/
unsigned long buffer_pos;
/**
* The have_forwarded_header instance variable is used to remember
* whether we have returned the file header to our reader yet.
*/
bool have_forwarded_header;
/**
* The have_given_result instance variable is used to remember
* whether we have returned the result to our reader yet.
*/
bool have_given_result;
/**
* The have_forwarded_start_address instance variable is used to
* remember whether we have returned the execution start address to
* our reader yet.
*/
bool have_forwarded_start_address;
/**
* The default constructor. Do not use.
*/
input_filter_message();
/**
* The copy constructor. Do not use.
*/
input_filter_message(const input_filter_message &);
/**
* The assignment operator. Do not use.
*/
input_filter_message &operator=(const input_filter_message &);
};
};
// vim: set ts=8 sw=4 et :
#endif // SRECORD_INPUT_FILTER_MESSAGE_H
|