srecord 1.65.0
 
Loading...
Searching...
No Matches
xor.h
Go to the documentation of this file.
1//
2// srecord - manipulate eprom load files
3// Copyright (C) 1998, 1999, 2001, 2002, 2005-2010 Peter Miller
4//
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU Lesser General Public License as published by
7// the Free Software Foundation; either version 3 of the License, or
8// (at your option) any later version.
9//
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 Lesser General Public License for more details.
14//
15// You should have received a copy of the GNU Lesser General Public License
16// along with this program. If not, see
17// <http://www.gnu.org/licenses/>.
18//
19
20#ifndef SRECORD_INPUT_FILTER_XOR_H
21#define SRECORD_INPUT_FILTER_XOR_H
22
24
25namespace srecord
26{
27
28/**
29 * The srecord::input_filter_xor clas sis used to represent the input state
30 * of a filter which bit-wise XORs all incoming data bytes with a fixed
31 * value.
32 */
33class input_filter_xor:
34 public input_filter
35{
36public:
37 /**
38 * The destructor.
39 */
41
42private:
43 /**
44 * The constructor.
45 *
46 * @param deeper
47 * The deeper input to be used as a data source.
48 * @param value
49 * The value to be bit-wise XORed with each incoming data byte.
50 */
51 input_filter_xor(const input::pointer &deeper, int value);
52
53public:
54 /**
55 * The create class method is used to create new dynamically
56 * allocated instances of this class.
57 *
58 * @param deeper
59 * The incoming data source to be filtered
60 * @param value
61 * The value to be bit-wise XORed with each incoming data byte.
62 */
63 static pointer create(const input::pointer &deeper, int value);
64
65protected:
66 // See base class for documentation.
68
69private:
70 /**
71 * The value instance variable is used to remember the value to be
72 * bit-wise XORed with each incoming data byte.
73 */
74 int value;
75
76 /**
77 * The default constructor. Do not use.
78 */
79 input_filter_xor();
80
81 /**
82 * The copy constructor. Do not use.
83 */
84 input_filter_xor(const input_filter_xor &);
85
86 /**
87 * The assignment operator. Do not use.
88 */
89 input_filter_xor &operator=(const input_filter_xor &);
90};
91
92};
93
94
95#endif // SRECORD_INPUT_FILTER_XOR_H
static pointer create(const input::pointer &deeper, int value)
The create class method is used to create new dynamically allocated instances of this class.
bool read(record &record)
The read method is used to read one record from the input.
virtual ~input_filter_xor()
The destructor.
input_filter(input::pointer deeper)
The constructor.
std::shared_ptr< input > pointer
Definition input.h:41
The srecord::record class is used to represent a data record read from a file.
Definition record.h:35