CARDS 2.4.140
Package manager for the NuTyX GNU/Linux distribution
pkg.h
1/*
2 * pkg.h
3 *
4 * Copyright 2017 - 2021 NuTyX <tnut@nutyx.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19 * MA 02110-1301, USA.
20 *
21 *
22 */
23
24#ifndef PKG_H
25#define PKG_H
26
27#include "string_utils.h"
28
29#include <string>
30
31enum CPSTATUS
32{
33 INSTALLED = 0x01,
34 TO_INSTALL = 0x02,
35 TO_REMOVE = 0x04,
36 TO_UPGRADE = 0x08
37};
38
39class Pkg
40{
41public:
42 Pkg();
43 ~Pkg();
44 std::string getName();
45 std::string getVersion();
46 std::string getPackager();
47 std::string getDescription();
48 std::string getCollection();
49 std::vector<std::string> getSet();
50 std::string getPrimarySet();
51 void setName(std::string& name);
52 void setDescription(std::string& description);
53 void setVersion(std::string& version);
54 void setCollection(std::string& collection);
55 void setSet(std::string& set);
56 void setPackager(std::string& packager);
57 bool isInstalled();
58 bool isToBeInstalled();
59 bool isToBeRemoved();
60 void setStatus(CPSTATUS pstatus);
61 void unSetStatus(CPSTATUS pstatus);
62 CPSTATUS getStatus();
63
64private:
65 std::string m_collection;
66 std::string m_set;
67 std::vector<std::string> m_setList;
68 std::string m_name;
69 std::string m_version;
70 std::string m_packager;
71 std::string m_description;
72 CPSTATUS m_status;
73};
74
75#endif /* PKG_H */
76// vim:set ts=2 :
Definition: libcards.h:851
~Pkg()
Destructor.
Definition: pkg.cxx:35
Pkg()
Constructor.
Definition: pkg.cxx:29
std::vector< std::string > getSet()
Return.
Definition: pkg.cxx:65