srecord: output/filter.h Source File

srecord 1.65.0

Loading...
Searching...
No Matches
filter.h
Go to the documentation of this file.
1//
2// srecord - Manipulate EPROM load files
3// Copyright (C) 2010, 2011 Peter Miller
4//
5// This program is free software; you can redistribute it and/or modify it
6// 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 (at your
8// option) any later version.
9//
10// This program is distributed in the hope that it will be useful, but WITHOUT
11// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13// 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 <http://www.gnu.org/licenses/>.
17//
18
19#ifndef SRECORD_OUTPUT_FILTER_H
20#define SRECORD_OUTPUT_FILTER_H
21
22#include <srecord/output.h>
23
24namespace srecord {
25
26/**
27 * The output_filter class is used to represent a generic output
28 * manipulation. Usually the major manipulations are done on input,
29 * these filters are output-specific.
30 */
31 class output_filter:
32 public output
33{
34public:
35 /**
36 * The destructor.
37 */
38 virtual ~output_filter();
39
40protected:
41 /**
42 * The constructor.
43 * For use by derived classes only.
44 *
45 * @param deeper
46 * Where to send our filtered output.
47 */
48 output_filter(const output::pointer &deeper);
49
50 // See base class for documentation.
51 void write(const record &r);
52
53 // See base class for documentation.
54 void line_length_set(int);
55
56 // See base class for documentation.
57 void address_length_set(int);
58
59 // See base class for documentation.
60 int preferred_block_size_get() const;
61
62 // See base class for documentation.
63 bool preferred_block_size_set(int nbytes);
64
65 // See base class for documentation.
66 const std::string filename() const;
67
68 // See base class for documentation.
69 const char *format_name() const;
70
71 // See base class for documentation.
72 void notify_upper_bound(unsigned long addr);
73
74 // See base class for documentation.
75 void command_line(arglex_tool *cmdln);
76
77private:
78 /**
79 * The deeper instance vatiable is used to remember where to send
80 * our filtered output.
81 */
82 output::pointer deeper;
83
84 /**
85 * The default constructor. Do not use.
86 */
87 output_filter();
88
89 /**
90 * The copy constructor. Do not use.
91 */
92 output_filter(const output_filter &);
93
94 /**
95 * The assignment operator. Do not use.
96 */
97 output_filter &operator=(const output_filter &);
98};
99
100};
101
102// vim: set ts=8 sw=4 et :
103#endif // SRECORD_OUTPUT_FILTER_H
srecord::arglex_tool
The srecord::arglex_tool is used to parse command line with srec-specific arguments.
Definition tool.h:41
srecord::output_filter::output_filter
output_filter(const output::pointer &deeper)
The constructor.
srecord::output_filter::preferred_block_size_set
bool preferred_block_size_set(int nbytes)
The preferred_block_size_set method is is to set a precific number of bytes for the preferred block s...
srecord::output_filter::address_length_set
void address_length_set(int)
The address_length_set method is used to set the minimum number of bytes to be written for addresses ...
srecord::output_filter::write
void write(const record &r)
The write method is used to write a recordonto an output.
srecord::output_filter::line_length_set
void line_length_set(int)
The set_line_length method is used to set the maximum length of an output line, for those formats for...
srecord::output_filter::command_line
void command_line(arglex_tool *cmdln)
The command_line method is used by arglex_srec::get_output when parsing the command line,...
srecord::output_filter::filename
const std::string filename() const
The filename method is used to determine the name of the output file.
srecord::output_filter::format_name
const char * format_name() const
The format_name method is used to obtain the name of this output format.
srecord::output_filter::preferred_block_size_get
int preferred_block_size_get() const
The preferred_block_size_get method is used to get the proferred block size of the output fformat.
srecord::output_filter::~output_filter
virtual ~output_filter()
The destructor.
srecord::output_filter::notify_upper_bound
void notify_upper_bound(unsigned long addr)
The notify_upper_bound method is used to notify the output class of the upper bound (highest address ...
srecord::output::output
output()
The default constructor.
srecord::output::pointer
std::shared_ptr< output > pointer
Definition output.h:41
srecord::record
The srecord::record class is used to represent a data record read from a file.
Definition record.h:35
srecord
Definition adler16.h:25
output.h