srecord: output/file/stewie.h Source File

srecord 1.65.0

Loading...
Searching...
No Matches
stewie.h
Go to the documentation of this file.
1//
2// srecord - manipulate eprom load files
3// Copyright (C) 2004, 2006-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_OUTPUT_FILE_STEWIE_H
21#define SRECORD_OUTPUT_FILE_STEWIE_H
22
23#include <srecord/output/file.h>
24
25namespace srecord
26{
27
28/**
29 * The srecord::output_file_stewie class is used to represent the current
30 * state of an output file in an undocumented binary format loosely
31 * based on the Motorola format.
32 */
33 class output_file_stewie:
34 public output_file
35{
36public:
37 /**
38 * The destructor.
39 */
40 virtual ~output_file_stewie();
41
42private:
43 /**
44 * The constructor. It is private on purpose, use the #create
45 * class method instead.
46 *
47 * @param file_name
48 * The name of the file to be written. The special name "-"
49 * indicates the standard output is to be used.
50 */
51 output_file_stewie(const std::string &file_name);
52
53public:
54 /**
55 * The create class method is used to create new dynamically
56 * allocated instances of this class.
57 *
58 * @param file_name
59 * The name of the file to be written.
60 */
61 static pointer create(const std::string &file_name);
62
63protected:
64 // See base class for documentation.
65 void write(const record &);
66
67 // See base class for documentation.
68 void line_length_set(int);
69
70 // See base class for documentation.
71 void address_length_set(int);
72
73 // See base class for documentation.
74 int preferred_block_size_get() const;
75
76 // See base class for documentation.
77 bool preferred_block_size_set(int nbytes);
78
79 // See base class for documentation.
80 void put_byte(unsigned char);
81
82 // See base class for documentation.
83 const char *format_name() const;
84
85private:
86 /**
87 * The data_count instance variable is used to remember how many
88 * data records have occurred so far in the output file.
89 */
90 unsigned long data_count;
91
92 /**
93 * The address_length instance variable is used to remember the
94 * minimum number of bytes to use for addresses.
95 */
96 int address_length;
97
98 /**
99 * The preferred_block_size instance variable is used to remember
100 * the prefrred block size for records.
101 */
102 int preferred_block_size;
103
104 /**
105 * Write a data record.
106 */
107 void write_inner(int, unsigned long, int, const void *, int);
108
109 /**
110 * The default constructor. Do not use.
111 */
112 output_file_stewie();
113
114 /**
115 * The copy constructor. Do not use.
116 */
117 output_file_stewie(const output_file_stewie &);
118
119 /**
120 * The assignment operator. Do not use.
121 */
122 output_file_stewie &operator=(const output_file_stewie &);
123};
124
125};
126
127#endif // SRECORD_OUTPUT_FILE_STEWIE_H
srecord::output_file_stewie::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_file_stewie::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_file_stewie::~output_file_stewie
virtual ~output_file_stewie()
The destructor.
srecord::output_file_stewie::write
void write(const record &)
The write method is used to write a recordonto an output.
srecord::output_file_stewie::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_file_stewie::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_file_stewie::put_byte
void put_byte(unsigned char)
The put_byte method is used to send a byte value to the output.
srecord::output_file_stewie::create
static pointer create(const std::string &file_name)
The create class method is used to create new dynamically allocated instances of this class.
srecord::output_file_stewie::format_name
const char * format_name() const
The format_name method is used to obtain the name of this output format.
srecord::output_file::output_file
output_file()
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
file.h