aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheofilos Intzoglou <int.teo@gmail.com>2011-10-09 02:42:38 +0300
committerTheofilos Intzoglou <int.teo@gmail.com>2011-10-09 02:42:38 +0300
commitc31cce5c15b253e55edcf86cafdaea10264347e1 (patch)
tree961e7649909491924a2070b822112ac45f1299ed
parentAdd some helper function used mostly for convertions between datatypes (diff)
downloadc-portage-c31cce5c15b253e55edcf86cafdaea10264347e1.tar.gz
c-portage-c31cce5c15b253e55edcf86cafdaea10264347e1.tar.bz2
c-portage-c31cce5c15b253e55edcf86cafdaea10264347e1.zip
The begginings of a portage class (compilable but not complete)
-rw-r--r--src/Qt/qportage.cpp178
-rw-r--r--src/Qt/qportage.h67
2 files changed, 245 insertions, 0 deletions
diff --git a/src/Qt/qportage.cpp b/src/Qt/qportage.cpp
new file mode 100644
index 0000000..bf313ea
--- /dev/null
+++ b/src/Qt/qportage.cpp
@@ -0,0 +1,178 @@
+/*
+ <one line to give the library's name and an idea of what it does.>
+ Copyright (C) 2011 Θεόφιλος Ιντζόγλου <int.teo@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+
+#include "helper.h"
+#include "qportage.h"
+#include <stringlist.h>
+#include <dataconnect.h>
+
+namespace CppPortage {
+
+portage::portage(QObject* parent): QObject(parent)
+{
+
+}
+
+portage::~portage()
+{
+
+}
+
+QString portage::bestVersion(QStringList )
+{
+
+}
+
+QStringList portage::getAllNodes()
+{
+ StringList *clist;
+ QStringList strlist;
+
+ clist = portageGetAllNodes();
+ strlist = CListToQStringList(clist);
+ stringListFree(clist);
+
+ return strlist;
+}
+
+QString portage::getBestEbuild(const QString& )
+{
+
+}
+
+QString portage::getDepEbuild(const QString& )
+{
+
+}
+
+int portage::getHardMasked(const QString& , QStringList& , QStringList& )
+{
+
+}
+
+QStringList portage::getInstalledFiles(const QString &package)
+{
+ StringList *clist;
+ QStringList strlist;
+
+ clist = portageGetInstalledFiles(package.toUtf8().data());
+ strlist = CListToQStringList(clist);
+ stringListFree(clist);
+
+ return strlist;
+}
+
+QStringList portage::getInstalledList()
+{
+ StringList *clist;
+ QStringList strlist;
+
+ clist = portageGetInstalledList();
+ strlist = CListToQStringList(clist);
+ stringListFree(clist);
+
+ return strlist;
+}
+
+QString portage::getMaskingReason(const QString& )
+{
+
+}
+
+QStringList portage::getMaskingStatus(const QString& )
+{
+
+}
+
+QString portage::getOverlay(const QString& )
+{
+
+}
+
+QString portage::getOverlayNameFromPath(const QString& )
+{
+
+}
+
+QString portage::getOverlayNameFromPkg(const QString& )
+{
+
+}
+
+long int portage::getPackageSizeInt(const QString& )
+{
+
+}
+
+QString portage::getPackageSizeString(const QString& )
+{
+
+}
+
+QString portage::getPath(const QString &package, int )
+{
+
+}
+
+PackageProperties* portage::getProperties(const QString &package)
+{
+ return portageGetProperties(package.toUtf8().data());
+}
+
+QStringList portage::getResolvedPkgs()
+{
+ StringList *clist;
+ QStringList strlist;
+
+ clist = portageGetResolvedPkgs();
+ strlist = CListToQStringList(clist);
+ stringListFree(clist);
+
+ return strlist;
+}
+
+QStringList portage::getUnresolvedPkgs()
+{
+ StringList *clist;
+ QStringList strlist;
+
+ clist = portageGetUnresolvedPkgs();
+ strlist = CListToQStringList(clist);
+ stringListFree(clist);
+
+ return strlist;
+}
+
+QStringList portage::getVersions(const QString &package, bool include_masked)
+{
+ StringList *clist = portageGetVersions(package.toUtf8().data(), include_masked);
+ QStringList strlist = CListToQStringList(clist);
+ stringListFree(clist);
+
+ return strlist;
+}
+
+bool portage::isOverlay(const QString &package)
+{
+ return portageIsOverlay(package.toUtf8().data());
+}
+
+
+} // End of namespace \ No newline at end of file
diff --git a/src/Qt/qportage.h b/src/Qt/qportage.h
new file mode 100644
index 0000000..8cdd7b3
--- /dev/null
+++ b/src/Qt/qportage.h
@@ -0,0 +1,67 @@
+/*
+ <one line to give the library's name and an idea of what it does.>
+ Copyright (C) 2011 Θεόφιλος Ιντζόγλου <int.teo@gmail.com>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+
+#ifndef QPORTAGE_H
+#define QPORTAGE_H
+
+#include <QObject>
+#include <QStringList>
+
+class PackageProperties;
+
+namespace CppPortage {
+
+class portage : public QObject
+{
+ Q_OBJECT
+
+ explicit portage(QObject* parent = 0);
+ virtual ~portage();
+
+ QStringList getVersions(const QString&, bool);
+ int getHardMasked(const QString&, QStringList&, QStringList&);
+ QStringList getInstalledFiles(const QString&);
+
+ QString bestVersion(QStringList);
+ QString getBestEbuild(const QString&);
+ QString getDepEbuild(const QString&);
+
+ QStringList getMaskingStatus(const QString&);
+ QString getMaskingReason(const QString&);
+
+ long int getPackageSizeInt(const QString&);
+ QString getPackageSizeString(const QString&);
+ PackageProperties* getProperties(const QString&);
+ bool isOverlay(const QString&);
+ QString getOverlay(const QString&);
+ QString getOverlayNameFromPath(const QString&);
+ QString getOverlayNameFromPkg(const QString&);
+ QString getPath(const QString&, int);
+
+ QStringList getResolvedPkgs();
+ QStringList getUnresolvedPkgs();
+ QStringList getAllNodes();
+ QStringList getInstalledList();
+
+}; // End of class
+
+} // End of namespace
+
+#endif // QPORTAGE_H