srecord 1.65.0
 
Loading...
Searching...
No Matches
atmel_generic.h
Go to the documentation of this file.
1//
2// srecord - manipulate eprom load files
3// Copyright (C) 2001, 2002, 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_ATMEL_GENERIC_H
21#define SRECORD_OUTPUT_FILE_ATMEL_GENERIC_H
22
23#include <srecord/endian.h>
24#include <srecord/output/file.h>
25
26namespace srecord
27{
28
29/**
30 * The srecord::output_file_ascii_hex class is used to write a file in
31 * Atmel Generic format.
32 */
33class output_file_atmel_generic:
34 public output_file
35{
36public:
37 /**
38 * The destructor.
39 */
41
42private:
43 /**
44 * The constructor.
45 *
46 * @param file_name
47 * The file to write the data to, or "-" to mean the standard
48 * output.
49 * @param end
50 * The byte order of the output.
51 */
52 output_file_atmel_generic(const std::string &file_name, endian_t end);
53
54public:
55 /**
56 * The create class method is used to create new dynamically
57 * allocated instances of this class.
58 *
59 * @param file_name
60 * The file name to open to write data to. The name "-" is
61 * understood to mean the standard output.
62 * @param end
63 * The byte order of the output.
64 */
65 static pointer create(const std::string &file_name, endian_t end);
66
67protected:
68 // See base class for documentation.
69 void write(const record &);
70
71 // See base class for documentation.
72 void line_length_set(int);
73
74 // See base class for documentation.
76
77 // See base class for documentation.
79
80 // See base class for documentation.
81 bool preferred_block_size_set(int nbytes);
82
83 // See base class for documentation.
84 const char *format_name() const;
85
86private:
87 /**
88 * The end instance variable is used to remember the byte order
89 * of the output, big-endian or little-endian.
90 */
91 endian_t end;
92
93 /**
94 * The default constructor. Do not use.
95 */
96 output_file_atmel_generic();
97
98 /**
99 * The copy constructor. Do not use.
100 */
101 output_file_atmel_generic(const output_file_atmel_generic &);
102
103 /**
104 * The copy constructor. Do not use.
105 */
106 output_file_atmel_generic &operator=(const output_file_atmel_generic &);
107};
108
109};
110
111#endif // SRECORD_OUTPUT_FILE_ATMEL_GENERIC_H
const char * format_name() const
The format_name method is used to obtain the name of this output format.
virtual ~output_file_atmel_generic()
The destructor.
int preferred_block_size_get() const
The preferred_block_size_get method is used to get the proferred block size of the output fformat.
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...
static pointer create(const std::string &file_name, endian_t end)
The create class method is used to create new dynamically allocated instances of this class.
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 address_length_set(int)
The address_length_set method is used to set the minimum number of bytes to be written for addresses ...
void write(const record &)
The write method is used to write a recordonto an output.
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
endian_t
Definition endian.h:27