Kstars
binfilehelper.cpp
101 // Read the first 124 bytes of the binary file which contains a general text about the binary data.
107 // Find out endianess from reading "KS" 0x4B53 in the binary file which was encoded on a little endian machine
108 // Therefore, in the binary file it is written as 53 4B (little endian as least significant byte is stored first),
109 // and when read on a little endian machine then it results in 0x4B53 (least significant byte is stored first in memory),
110 // whereas a big endian machine would read it as 0x534B (most significant byte is stored first in memory).
182 // We read each 12-byte index entry (ID[4], Offset[4] within file in bytes, nrec[4] # of Records).
189 errorMessage = QStringLiteral("Table truncated before expected! Read i = %1 index entries so far").arg(QString::number(j));
198 errorMessage = QString::asprintf("ID %u is greater than the expected number of expected entries (%u)", ID, indexSize);
204 errorMessage = QString::asprintf("Found ID %u, at the location where ID %u was expected", ID, j);
210 errorMessage = QString::asprintf("Table truncated before expected! Read i = %d index entries so far", j);
219 errorMessage = QString::asprintf("Table truncated before expected! Read i = %d index entries so far", j);
229 errorMessage = QString::asprintf("Expected %u = (%X - %x) / %x records, but found %u, in index entry %u",
static int unsigned_KDE_fseek(FILE *stream, quint32 offset, int whence)
Wrapper around fseek for large offsets.
Definition: binfilehelper.cpp:321
QString number(int n, int base)
static bool testFileExists(const QString &fileName)
Checks if a file exists.
Definition: binfilehelper.cpp:57
bool readHeader()
Read the header and index table from the file and fill up the QVector s with the entries.
Definition: binfilehelper.cpp:250
void append(const T &value)
QByteArray toLatin1() const const
bool isField(const QString &FieldName) const
Check whether a field exists.
Definition: binfilehelper.cpp:311
void clear()
Implements an interface to handle binary data files used by KStars.
Definition: binfilehelper.h:38
AppLocalDataLocation
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
int size() const const
QString asprintf(const char *cformat,...)
char * data()
FILE * openFile(const QString &fileName)
WARNING: This function may not be compatible in other locales, because it calls QString::toAscii.
Definition: binfilehelper.cpp:72
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Jun 4 2023 03:57:11 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Jun 4 2023 03:57:11 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.