Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=cfpm.git;a=commitdiff;h=619d4f8200e117b113e0742006d5ebd12e48b906

commit 619d4f8200e117b113e0742006d5ebd12e48b906
Author: Priyank <priy...@frugalware.org>
Date:   Sat Jun 6 00:34:52 2009 +0530

new class : Group
* Initial draft

diff --git a/pm.cc b/pm.cc
index 41fca51..d54b4e6 100644
--- a/pm.cc
+++ b/pm.cc
@@ -30,6 +30,7 @@ using std::string;
using PM::Shared;
using PM::Database;
using PM::Package;
+using PM::Group;

bool PM::initialize(const string &root)
{
@@ -269,3 +270,34 @@ void Package::free()
setStatus();
}

+Group::Group()
+{
+       grp = NULL;
+}
+
+Group::Group(PM_GRP *g)
+{
+       Group();
+       grp = g;
+}
+
+Group::~Group()
+{
+       return;
+}
+
+void * Group::getInfo(unsigned char param)
+{
+       void *ret = NULL;
+
+       if ( !(ret=pacman_grp_getinfo(grp,param)) )
+               setStatus();
+       return ret;
+}
+
+string Group::getName()
+{
+       string ret = (char*) getInfo(PM_GRP_NAME);
+       return ret;
+}
+
diff --git a/pm.hh b/pm.hh
index 9f77e85..3d7fa83 100644
--- a/pm.hh
+++ b/pm.hh
@@ -67,5 +67,17 @@ namespace PM
bool checkSHA1Sum();
void free();
};
+
+       class Group : public Shared
+       {
+               PM_GRP *grp;
+
+               public:
+                       Group();
+                       Group(PM_GRP *g);
+                       ~Group();
+                       void* getInfo(unsigned char param);
+                       std::string getName();
+       };
}
#endif
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to