# openPilotLog: src/database/entry_deprecated.h Source File

entry_deprecated.h
/*
*openPilot Log - A FOSS Pilot Logbook Application
*Copyright (C) 2020 Felix Turowsky
*
*This program is free software: you can redistribute it and/or modify
*it under the terms of the GNU General Public License as published by
*the Free Software Foundation, either version 3 of the License, or
*(at your option) any later version.
*
*This program is distributed in the hope that it will be useful,
*but WITHOUT ANY WARRANTY; without even the implied warranty of
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*GNU General Public License for more details.
*
*You should have received a copy of the GNU General Public License
*along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef ENTRY1_H
#define ENTRY1_H
#include <QCoreApplication>
#include "db.h"
#include "dbinfo.h"
class Entry_deprecated
{
public:
Entry_deprecated();
Entry_deprecated(QString table, int row);
Entry_deprecated(QString table, QMap<QString, QString> newData);
QPair <QString, int> position = QPair<QString, int>(); // Position within the database, i.e. <table,row>
QVector <QString> columns = QVector<QString>(); // The columns within the table
QMap <QString, QString> data = QMap<QString, QString>(); // Tha data to fill that table, <column,value>
QString error = QString(); // holds sql errors (if they ocurred)
void setData(QMap<QString, QString> &value);
bool commit();
bool remove();
bool exists();
// Debug functionality
void print();
QString debug();
operator QString()
{
return debug(); //overload for compatibility with qDebug()
}
private:
bool insert();
bool update();
};
#endif // ENTRY_H
Entry_deprecated
The Entry class is the base class for database entries. It can be seen as a row in a table within the...
Definition: entry_deprecated.h:30