QEpromFileBase Class.
More...
#include <qepromfilebase.hpp>
|
| static bool | isReadable (const QString &filename) |
| | Returns if file is readable in this format. More...
|
| |
QEpromFileBase Class.
The purpose of this class is to be an interface to all the EPROM File Manipulator classes.
◆ QEpromFileType
Eprom File Types.
| Enumerator |
|---|
| EpromFileBin | Binary file (raw).
|
| EpromFileSRec | Motorola S-REC file.
|
| EpromFileHex | Intel Hex file.
|
| EpromFileAtmel | Atmel Generic file.
|
◆ QEpromFileBase()
Constructor.
- Parameters
-
| parent | Pointer to parent object (default = nullptr). |
◆ isReadable()
| bool isReadable |
( |
const QString & |
filename | ) |
|
|
static |
Returns if file is readable in this format.
- Parameters
-
| filename | Filename (with path). |
- Returns
- True if success, false otherwise.
◆ read()
| virtual QByteArray read |
( |
const QString & |
filename, |
|
|
qint32 |
size |
|
) |
| |
|
pure virtual |
Reads data from a file.
- Parameters
-
| filename | Filename (with path). |
| size | Size of data to be read (in bytes). If file is smaller than this parameter, data is filled with 0xFF. |
- Returns
- Byte array with data, or empty if an error occurs.
Implemented in QSrecFile, QHexFile, QEpromFile, QBinFile, and QAtmelFile.
◆ write()
| virtual bool write |
( |
QEpromFileType |
type, |
|
|
const QString & |
filename, |
|
|
const QByteArray & |
data |
|
) |
| |
|
pure virtual |
Writes data to a file.
- Parameters
-
| type | Type of the file to write. |
| filename | Filename (with path). |
| data | Data to write. |
- Returns
- True if success, false otherwise.
Implemented in QSrecFile, QHexFile, QEpromFile, QBinFile, and QAtmelFile.
◆ getFilename()
| QString getFilename |
( |
void |
| ) |
const |
|
virtual |
Gets the filename used to read or write the file.
- Returns
- The filename, or empty if file wasn't saved/opened yet.
◆ getType()
Gets the type of the file opened/saved.
- Returns
- Type of the file.
The documentation for this class was generated from the following files: