1 /*
2 * Copyright (C) 2017-2018 Red Hat, Inc.
3 *
4 * Licensed under the GNU Lesser General Public License Version 2.1
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * This library 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 GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #ifndef LIBDNF_NSVCAP_HPP
22 #define LIBDNF_NSVCAP_HPP
23
24 #include "hy-subject.h"
25
26 #include <string>
27
28 namespace libdnf {
29
30 struct Nsvcap {
31 public:
32 bool parse(const char *nsvcapStr, HyModuleForm form);
33 void clear();
34
35 const std::string & getName() const noexcept;
36 const std::string & getStream() const noexcept;
37 const std::string & getVersion() const noexcept;
38 const std::string & getContext() const noexcept;
39 const std::string & getArch() const noexcept;
40 const std::string & getProfile() const noexcept;
41
42 void setName(const std::string & name);
43 void setStream(const std::string & stream);
44 void setVersion(const std::string & stream);
45 void setContext(const std::string & context);
46 void setArch(const std::string & arch);
47 void setProfile(const std::string & profile);
48
49 void setName(std::string && name);
50 void setStream(std::string && stream);
51 void setVersion(std::string && stream);
52 void setContext(std::string && context);
53 void setArch(std::string && arch);
54 void setProfile(std::string && profile);
55
56 private:
57 std::string name;
58 std::string stream;
59 std::string version;
60 std::string context;
61 std::string arch;
62 std::string profile;
63 };
64
getName() const65 inline const std::string & Nsvcap::getName() const noexcept
66 {
67 return name;
68 }
69
getStream() const70 inline const std::string & Nsvcap::getStream() const noexcept
71 {
72 return stream;
73 }
74
getVersion() const75 inline const std::string & Nsvcap::getVersion() const noexcept
76 {
77 return version;
78 }
79
getContext() const80 inline const std::string & Nsvcap::getContext() const noexcept
81 {
82 return context;
83 }
84
getArch() const85 inline const std::string & Nsvcap::getArch() const noexcept
86 {
87 return arch;
88 }
89
getProfile() const90 inline const std::string & Nsvcap::getProfile() const noexcept
91 {
92 return profile;
93 }
94
setName(const std::string & name)95 inline void Nsvcap::setName(const std::string & name)
96 {
97 this->name = name;
98 }
99
setStream(const std::string & stream)100 inline void Nsvcap::setStream(const std::string & stream)
101 {
102 this->stream = stream;
103 }
104
setVersion(const std::string & version)105 inline void Nsvcap::setVersion(const std::string & version)
106 {
107 this->version = version;
108 }
109
setContext(const std::string & context)110 inline void Nsvcap::setContext(const std::string & context)
111 {
112 this->context = context;
113 }
114
setArch(const std::string & arch)115 inline void Nsvcap::setArch(const std::string & arch)
116 {
117 this->arch = arch;
118 }
119
setProfile(const std::string & profile)120 inline void Nsvcap::setProfile(const std::string & profile)
121 {
122 this->profile = profile;
123 }
124
setName(std::string && name)125 inline void Nsvcap::setName(std::string && name)
126 {
127 this->name = std::move(name);
128 }
129
setStream(std::string && stream)130 inline void Nsvcap::setStream(std::string && stream)
131 {
132 this->stream = std::move(stream);
133 }
134
setVersion(std::string && version)135 inline void Nsvcap::setVersion(std::string && version)
136 {
137 this->version = std::move(version);
138 }
139
setContext(std::string && context)140 inline void Nsvcap::setContext(std::string && context)
141 {
142 this->context = std::move(context);
143 }
144
setArch(std::string && arch)145 inline void Nsvcap::setArch(std::string && arch)
146 {
147 this->arch = std::move(arch);
148 }
149
setProfile(std::string && profile)150 inline void Nsvcap::setProfile(std::string && profile)
151 {
152 this->profile = std::move(profile);
153 }
154
155 }
156
157 #endif //LIBDNF_NSVCAP_HPP
158