srecord: output/file/spasm.h Source File

srecord 1.65.0

Loading...
Searching...
No Matches
spasm.h
Go to the documentation of this file.
1//
2// srecord - manipulate eprom load files
3// Copyright (C) 2001, 2002, 2005-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_SPASM_H
21#define SRECORD_OUTPUT_FILE_SPASM_H
22
23#include <srecord/endian.h>
24#include <srecord/output/file.h>
25
26namespace srecord
27{
28
29/**
30 * The srecord::output_file_spasm class is used to represent an output
31 * files in SPASM format.
32 */
33 class output_file_spasm:
34 public output_file
35{
36public:
37 /**
38 * The destructor.
39 */
40 virtual ~output_file_spasm();
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 * @param end
51 * The byte order of the file
52 */
53 output_file_spasm(const std::string &file_name, endian_t end);
54
55public:
56 /**
57 * The create class method is used to create new dynamically
58 * allocated instances of this class.
59 *
60 * @param file_name
61 * The name of the file to be written.
62 * @param end
63 * The byte order of the file
64 */
65 static pointer create(const std::string &file_name,
66 endian_t end = endian_big);
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.
76 void address_length_set(int);
77
78 // See base class for documentation.
79 int preferred_block_size_get() const;
80
81 // See base class for documentation.
82 bool preferred_block_size_set(int nbytes);
83
84 // See base class for documentation.
85 const char *format_name() const;
86
87private:
88 /**
89 * The end instance variable is used to remember the byte order of
90 * the file.
91 */
92 endian_t end;
93
94 /**
95 * The default constructor. Do not use.
96 */
97 output_file_spasm();
98
99 /**
100 * The copy constructor. Do not use.
101 */
102 output_file_spasm(const output_file_spasm &);
103
104 /**
105 * The assignment operator. Do not use.
106 */
107 output_file_spasm &operator=(const output_file_spasm &);
108};
109
110};
111
112#endif // SRECORD_OUTPUT_FILE_SPASM_H
srecord::output_file_spasm::format_name
const char * format_name() const
The format_name method is used to obtain the name of this output format.
srecord::output_file_spasm::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_spasm::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_spasm::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_spasm::create
static pointer create(const std::string &file_name, endian_t end=endian_big)
The create class method is used to create new dynamically allocated instances of this class.
srecord::output_file_spasm::~output_file_spasm
virtual ~output_file_spasm()
The destructor.
srecord::output_file_spasm::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_spasm::write
void write(const record &)
The write method is used to write a recordonto an output.
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
endian.h
srecord
Definition adler16.h:25
srecord::endian_t
endian_t
Definition endian.h:27
srecord::endian_big
@ endian_big
Definition endian.h:28
file.h