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-2003, 2006-2008, 2010, 2011, 2013 Peter Miller
4//
5// This program is free software; you can redistribute it and/or modify it
6// 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 (at your
8// option) any later version.
9//
10// This program is distributed in the hope that it will be useful, but WITHOUT
11// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12// FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
13// 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 <http://www.gnu.org/licenses/>.
17//
18
19#ifndef SRECORD_INPUT_FILE_ATMEL_GENERIC_H
20#define SRECORD_INPUT_FILE_ATMEL_GENERIC_H
21
22#include <srecord/endian.h>
23#include <srecord/input/file.h>
24
25namespace srecord {
26
27/**
28 * The srecord::input_file_atmel_generic class is used to represent the
29 * parse stat of an Atmel Genric formatted file.
30 */
31class input_file_atmel_generic:
32 public input_file
33{
34public:
35 /**
36 * The destructor.
37 */
39
40 /**
41 * The create class method is used to create new dynamically
42 * allocated instances of this class.
43 *
44 * @param file_name
45 * The name of the file to be read.
46 * @returns
47 * smart pointer to new instance
48 */
49 static pointer create_be(const std::string &file_name);
50
51 /**
52 * The create class method is used to create new dynamically
53 * allocated instances of this class.
54 *
55 * @param file_name
56 * The name of the file to be read.
57 * @param end
58 * The endian-ness of the file
59 * @returns
60 * smart pointer to new instance
61 */
62 static pointer create(const std::string &file_name,
63 endian_t end = endian_big);
64
65protected:
66 // See base class for documentation.
68
69 // See base class for documentation.
70 const char *get_file_format_name() const;
71
72 // See base class for documentation.
73 int format_option_number(void) const;
74
75private:
76 /**
77 * the constructor.
78 *
79 * @param file_name
80 * The name of the file to be read.
81 * @param end
82 * The byte order.
83 */
84 input_file_atmel_generic(const std::string &file_name, endian_t end);
85
86 /**
87 * The read_inner method is used to read a single record form
88 * the file. The read method is a wrapper around it.
89 */
90 bool read_inner(record &);
91
92 /**
93 * The seen_some_input instance variable is used to remember whther
94 * any input data has been seen to date.
95 */
96 bool seen_some_input;
97
98 /**
99 * The end instance variable is used to remember whether the
100 * input is big endian or little endian.
101 */
102 endian_t end;
103
104 /**
105 * The deafult constructor. Do not use.
106 */
107 input_file_atmel_generic();
108
109 /**
110 * The copy constructor. Do not use.
111 */
112 input_file_atmel_generic(const input_file_atmel_generic &);
113
114 /**
115 * The assignment operator. Do not use.
116 */
117 input_file_atmel_generic &operator=(const input_file_atmel_generic &);
118};
119
120};
121
122#endif // SRECORD_INPUT_FILE_ATMEL_GENERIC_H
123// vim: set ts=8 sw=4 et :
virtual ~input_file_atmel_generic()
The destructor.
bool read(record &record)
The read method is used to read one record from the input.
int format_option_number(void) const
The format_option_number method is used to obtain the option number, which can then be turned into te...
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.
static pointer create_be(const std::string &file_name)
The create class method is used to create new dynamically allocated instances of this class.
const char * get_file_format_name() const
The get_file_format_name method is used to find out the name of the file format being read.
input_file(const std::string &file_name)
The constructor.
std::shared_ptr< input_file > pointer
Definition file.h:39
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
@ endian_big
Definition endian.h:28