/* * Copyright 2020 Michail Vourlakos * * This file is part of Latte-Dock * * Latte-Dock 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 2 of * the License, or (at your option) any later version. * * Latte-Dock 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 . * */ #ifndef GENERICTABLEDATA_H #define GENERICTABLEDATA_H // local #include "genericdata.h" // Qt #include namespace Latte { namespace Data { template class GenericTable { public: GenericTable(); GenericTable(GenericTable &&o); GenericTable(const GenericTable &o); //! Operators GenericTable &operator=(const GenericTable &rhs); GenericTable &operator=(GenericTable &&rhs); GenericTable &operator<<(const T &rhs); GenericTable &operator<<(const GenericTable &rhs); GenericTable &insert(const int &pos, const T &rhs); GenericTable &insertBasedOnName(const T &rhs); GenericTable &insertBasedOnId(const T &rhs); bool operator==(const GenericTable &rhs) const; bool operator!=(const GenericTable &rhs) const; T &operator[](const QString &id); const T operator[](const QString &id) const; T &operator[](const uint &index); const T operator[](const uint &index) const; operator QString() const; bool containsId(const QString &id) const; bool containsName(const QString &name) const; bool rowExists(const int &row) const; int indexOf(const QString &id) const; int rowCount() const; int sortedPosForName(const QString &name) const; int sortedPosForId(const QString &id) const; QString idForName(const QString &name) const; QStringList names() const; void clear(); void remove(const int &row); void remove(const QString &id); protected: //! #id, record QList m_list; }; } } #endif