srecord  1.65.0
tektronix.h
Go to the documentation of this file.
1 //
2 // srecord - manipulate eprom load files
3 // Copyright (C) 1998, 1999, 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_TEKTRONIX_H
21 #define SRECORD_OUTPUT_FILE_TEKTRONIX_H
22 
23 #include <srecord/output/file.h>
24 
25 namespace srecord
26 {
27 
28 /**
29  * The srecord::output_file_tektronix class is used to represent an output
30  * file which is in Tektronix format.
31  */
33  public output_file
34 {
35 public:
36  /**
37  * The destructor.
38  */
40 
41 private:
42  /**
43  * The constructor. It is private on purpose, use the #create
44  * class method instead.
45  *
46  * @param file_name
47  * The name of the file to be written. The special name "-"
48  * indicates the standard output is to be used.
49  */
50  output_file_tektronix(const std::string &file_name);
51 
52 public:
53  /**
54  * The create class method is used to create new dynamically
55  * allocated instances of this class.
56  *
57  * @param file_name
58  * The name of the file to be written.
59  */
60  static pointer create(const std::string &file_name);
61 
62 protected:
63  // See base class for documentation.
64  void write(const record &);
65 
66  // See base class for documentation.
67  void line_length_set(int);
68 
69  // See base class for documentation.
70  void address_length_set(int);
71 
72  // See base class for documentation.
74 
75  // See base class for documentation.
76  bool preferred_block_size_set(int nbytes);
77 
78  // See base class for documentation.
79  void put_nibble(int);
80 
81  // See base class for documentation.
82  void put_byte(unsigned char);
83 
84  // See base class for documentation.
85  const char *format_name() const;
86 
87 private:
88  /**
89  * The pref_block_size instance variable is used to remember the
90  * preferred number of data bytes (NOT encoded hex characters) to
91  * be placed in each output line.
92  */
93  int pref_block_size;
94 
95  /**
96  * The write_inner method is used to write a line of output.
97  *
98  * @param address
99  * The address of the first byte of data on the line.
100  * @param data
101  * The palyload of this line.
102  * @param data_nbytes
103  * The number of bytes of payload.
104  */
105  void write_inner(unsigned long address, const void *data, int data_nbytes);
106 
107  /**
108  * The default constructor. Do not use.
109  */
111 
112  /**
113  * The copy constructor. Do not use.
114  */
116 
117  /**
118  * The assignment operator. Do not use.
119  */
120  output_file_tektronix &operator=(const output_file_tektronix &);
121 };
122 
123 };
124 
125 #endif // SRECORD_OUTPUT_FILE_TEKTRONIX_H
The srecord::output_file_tektronix class is used to represent an output file which is in Tektronix fo...
Definition: tektronix.h:34
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.
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...
int preferred_block_size_get() const
The preferred_block_size_get method is used to get the proferred block size of the output fformat.
virtual ~output_file_tektronix()
The destructor.
const char * format_name() const
The format_name method is used to obtain the name of this output format.
static pointer create(const std::string &file_name)
The create class method is used to create new dynamically allocated instances of this class.
void put_byte(unsigned char)
The put_byte method is used to send a byte value to the output.
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...
The srecord::output_file class is used to represent a generic output file.
Definition: file.h:35
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