srecord 1.65.0
 
Loading...
Searching...
No Matches
offset.h
Go to the documentation of this file.
1//
2// srecord - manipulate eprom load files
3// Copyright (C) 1998, 1999, 2001, 2002, 2005-2008, 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_OFFSET_H
21#define SRECORD_INPUT_FILTER_OFFSET_H
22
24
25namespace srecord
26{
27
28/**
29 * The srecord::input_filter_offset class is used to represent a filetr
30 * where the addresses of the the deeper input source are offset by a
31 * number of bytes.
32 */
33class input_filter_offset:
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 stream.
48 * @param nbytes
49 * The number of bytes to offset the addresses by.
50 * The value may be negative.
51 */
52 input_filter_offset(const input::pointer &deeper, long nbytes);
53
54public:
55 /**
56 * The create class method is used to create new dynamically
57 * allocated instances of this class.
58 *
59 * @param deeper
60 * The incoming data source to be filtered
61 * @param nbytes
62 * The number of bytes to offset the addresses by.
63 * The value may be negative.
64 */
65 static pointer create(const input::pointer &deeper, long nbytes);
66
67protected:
68 // See base class for documentation.
70
71private:
72 /**
73 * The nbytes instance variable is used to remember the number of
74 * bytes to affset the data by.
75 */
76 long nbytes;
77
78 /**
79 * The default constructor. Do not use.
80 */
81 input_filter_offset();
82
83 /**
84 * The copy constructor. Do not use.
85 */
86 input_filter_offset(const input_filter_offset &);
87
88 /**
89 * The assignment operator. Do not use.
90 */
91 input_filter_offset &operator=(const input_filter_offset &);
92};
93
94};
95
96#endif // SRECORD_INPUT_FILTER_OFFSET_H
virtual ~input_filter_offset()
The destructor.
bool read(record &record)
The read method is used to read one record from the input.
static pointer create(const input::pointer &deeper, long nbytes)
The create class method is used to create new dynamically allocated instances of this class.
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