srecord 1.65.0
 
Loading...
Searching...
No Matches
wilson.h
Go to the documentation of this file.
1//
2// srecord - manipulate eprom load files
3// Copyright (C) 2000-2002, 2005-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
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_WILSON_H
21#define SRECORD_OUTPUT_FILE_WILSON_H
22
23#include <srecord/output/file.h>
24
25namespace srecord
26{
27
28/**
29 * The srecord::output_file_wilson class is used to represent an output
30 * file which is in "wilson" format. This file format was reverse
31 * engineered, it wasn't documented anywhere. More information would
32 * be welcome.
33 *
34 * @sa
35 * #srecord::output_file_motorola,
36 * #srecord::output_file_idt,
37 */
38class output_file_wilson:
39 public output_file
40{
41public:
42 /**
43 * The destructor.
44 */
46
47private:
48 /**
49 * The constructor. It is private on purpose, use the #create
50 * class method instead.
51 *
52 * @param file_name
53 * The name of the file to be written. The special name "-"
54 * indicates the standard output is to be used.
55 */
56 output_file_wilson(const std::string &file_name);
57
58public:
59 /**
60 * The create class method is used to create new dynamically
61 * allocated instances of this class.
62 *
63 * @param file_name
64 * The name of the file to be written.
65 */
66 static pointer create(const std::string &file_name);
67
68protected:
69 // See base class for documentation.
70 void write(const record &);
71
72 // See base class for documentation.
73 void line_length_set(int);
74
75 // See base class for documentation.
77
78 // See base class for documentation.
80
81 // See base class for documentation.
82 bool preferred_block_size_set(int nbytes);
83
84 // See base class for documentation.
85 void put_byte(unsigned char);
86
87 // See base class for documentation.
88 const char *format_name() const;
89
90 // See base class for documentation.
91 bool is_binary(void) const;
92
93private:
94 /**
95 * The pref_block_size instance variable is used to remember the
96 * preferred number of data bytes (NOT encoded hex characters) to
97 * be placed in each output line.
98 */
99 int pref_block_size;
100
101 /**
102 * The write_inner method is used to write a line of output.
103 *
104 * @param tag
105 * The tag value at the start of the line.
106 * @param address
107 * The address of the first byte of data on the line.
108 * @param data
109 * The palyload of this line.
110 * @param data_nbytes
111 * The number of bytes of payload.
112 */
113 void write_inner(int tag, unsigned long address, const void *data,
114 int data_nbytes);
115
116 /**
117 * The default constructor. Do not use.
118 */
119 output_file_wilson();
120
121 /**
122 * The copy constructor. Do not use.
123 */
124 output_file_wilson(const output_file_wilson &);
125
126 /**
127 * The assignment operator. Do not use.
128 */
129 output_file_wilson &operator=(const output_file_wilson &);
130};
131
132};
133
134#endif // SRECORD_OUTPUT_FILE_WILSON_H
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...
void put_byte(unsigned char)
The put_byte method is used to send a byte value to the output.
virtual ~output_file_wilson()
The destructor.
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...
void write(const record &)
The write method is used to write a recordonto an output.
const char * format_name() const
The format_name method is used to obtain the name of this output format.
void address_length_set(int)
The address_length_set method is used to set the minimum number of bytes to be written for addresses ...
static pointer create(const std::string &file_name)
The create class method is used to create new dynamically allocated instances of this class.
int preferred_block_size_get() const
The preferred_block_size_get method is used to get the proferred block size of the output fformat.
bool is_binary(void) const
The is_binary method is used to to determine whether or not a file format is binary (true) of text (f...
output_file()
The default constructor.
std::shared_ptr< output > pointer
Definition output.h:41
The srecord::record class is used to represent a data record read from a file.
Definition record.h:35