srecord: input/catenate.h Source File

srecord 1.65.0

Loading...
Searching...
No Matches
catenate.h
Go to the documentation of this file.
1//
2// srecord - Manipulate EPROM load files
3// Copyright (C) 2008, 2010, 2011 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 (at
8// 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 GNU
13// 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 <http://www.gnu.org/licenses/>.
17//
18
19#ifndef SRECORD_INPUT_CATENATE_H
20#define SRECORD_INPUT_CATENATE_H
21
22#include <srecord/input.h>
23
24namespace srecord {
25
26/**
27 * The srecord::input_catenate class is used to represent an input source
28 * which presents two inoput sources as if they were a single input
29 * source.
30 */
31 class input_catenate:
32 public input
33{
34public:
35 /**
36 * The destructor.
37 */
38 virtual ~input_catenate();
39
40private:
41 /**
42 * The constructor.
43 * It is private on purpose, use the #create class method instead.
44 *
45 * @param in1
46 * The first of the inputs to be read.
47 * @param in2
48 * The second of the inputs to be read.
49 */
50 input_catenate(const pointer &in1, const pointer &in2);
51
52public:
53 /**
54 * The create class method is used to create new dynamically
55 * allocated instances of this class.
56 *
57 * @param in1
58 * The first of the inputs to be read.
59 * @param in2
60 * The second of the inputs to be read.
61 */
62 static pointer create(const pointer &in1, const pointer &in2);
63
64protected:
65 // See base class for documentation.
66 bool read(record &record);
67
68 // See base class for documentation.
69 std::string filename() const;
70
71 // See base class for documentation.
72 std::string filename_and_line() const;
73
74 // See base class for documentation.
75 const char *get_file_format_name() const;
76
77 // See base class for documentation.
78 void disable_checksum_validation();
79
80private:
81 /**
82 * The in1 instance variable is used to remember the first of the
83 * inputs to be read.
84 */
85 pointer in1;
86
87 /**
88 * The in2 instance variable is used to remember the second of the
89 * inputs to be read.
90 */
91 pointer in2;
92
93 /**
94 * The default constructor. Do not use.
95 */
96 input_catenate();
97
98 /**
99 * The copy constructor. Do not use.
100 */
101 input_catenate(const input_catenate &);
102
103 /**
104 * The assignment operator. Do not use.
105 */
106 input_catenate &operator=(const input_catenate &);
107};
108
109};
110
111// vim: set ts=8 sw=4 et :
112#endif // SRECORD_INPUT_CATENATE_H
srecord::input_catenate::~input_catenate
virtual ~input_catenate()
The destructor.
srecord::input_catenate::read
bool read(record &record)
The read method is used to read one record from the input.
srecord::input_catenate::filename_and_line
std::string filename_and_line() const
The filename_and_line method is used to get the name and current line number within the file.
srecord::input_catenate::disable_checksum_validation
void disable_checksum_validation()
The disable_checksum_validation method is used to have this input stream ignore checksum errors.
srecord::input_catenate::filename
std::string filename() const
The filename method is used to get the name of the input file being processed.
srecord::input_catenate::create
static pointer create(const pointer &in1, const pointer &in2)
The create class method is used to create new dynamically allocated instances of this class.
srecord::input_catenate::get_file_format_name
const char * get_file_format_name() const
The get_file_format_name method is used to find out the name of the file format being read.
srecord::input::input
input()
The default constructor.
srecord::input::pointer
std::shared_ptr< input > pointer
Definition input.h:41
srecord::record
The srecord::record class is used to represent a data record read from a file.
Definition record.h:35
input.h
srecord
Definition adler16.h:25