616f1173ba4f1799e0477c6d1f19b9bf6c0da7f5
[platform/upstream/libzypp.git] / zypp / sat / SolvAttr.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/SolvAttr.h
10  *
11 */
12 #ifndef ZYPP_SolvAttr_H
13 #define ZYPP_SolvAttr_H
14
15 #include <iosfwd>
16 #include <string>
17
18 #include "zypp/base/String.h"
19 #include "zypp/IdStringType.h"
20
21 ///////////////////////////////////////////////////////////////////
22 namespace zypp
23 { /////////////////////////////////////////////////////////////////
24 namespace sat
25 { /////////////////////////////////////////////////////////////////
26
27
28   ///////////////////////////////////////////////////////////////////
29   //
30   //    CLASS NAME : SolvAttr
31   //
32   /** Solvable attribute keys.
33    */
34   class SolvAttr : public IdStringType<SolvAttr>
35   {
36     public:
37       /** \name Some builtin SolvAttr constants. */
38       //@{
39       /** Value to request searching all Attributes (0). */
40       static const SolvAttr allAttr;
41       /** Value representing \c noAttr (<tt>""</tt>)*/
42       static const SolvAttr noAttr;
43
44       /** \name special solvable attributes which are part of the ::Solvable struct
45        *
46        * \todo can these be used in LookupAttr currently?
47        * \todo add dependencies here? Or move all this stuff elsewhere?
48        */
49       //@{
50       static const SolvAttr name;
51       static const SolvAttr edition;
52       static const SolvAttr arch;
53       //@}
54
55       /** \name common */
56       //@{
57       static const SolvAttr summary;
58       static const SolvAttr description;
59       static const SolvAttr insnotify;
60       static const SolvAttr delnotify;
61       static const SolvAttr eula;
62       static const SolvAttr installtime;
63       static const SolvAttr buildtime;
64       static const SolvAttr installsize;
65       static const SolvAttr downloadsize;
66       static const SolvAttr diskusage;
67       static const SolvAttr cpename;
68       //@}
69
70       /** \name package */
71       //@{
72       static const SolvAttr checksum;
73       static const SolvAttr mediadir;
74       static const SolvAttr medianr;
75       static const SolvAttr mediafile;
76       static const SolvAttr changelog;
77       static const SolvAttr buildhost;
78       static const SolvAttr distribution;
79       static const SolvAttr license;
80       static const SolvAttr packager;
81       static const SolvAttr group;
82       static const SolvAttr keywords;
83       static const SolvAttr sourcesize;
84       static const SolvAttr authors;
85       static const SolvAttr filenames;
86       static const SolvAttr filelist;
87       static const SolvAttr sourcearch;
88       static const SolvAttr sourcename;
89       static const SolvAttr sourceevr;
90       static const SolvAttr headerend;
91       static const SolvAttr url;
92       //@}
93
94        /** \name patch */
95       //@{
96       static const SolvAttr patchcategory;
97       static const SolvAttr rebootSuggested;
98       static const SolvAttr restartSuggested;
99       static const SolvAttr reloginSuggested;
100       static const SolvAttr message;
101       static const SolvAttr updateCollectionName;
102       static const SolvAttr updateCollectionEvr;
103       static const SolvAttr updateCollectionArch;
104       static const SolvAttr updateCollectionFilename;
105       static const SolvAttr updateCollectionFlags;
106       static const SolvAttr updateReferenceType;
107       static const SolvAttr updateReferenceHref;
108       static const SolvAttr updateReferenceId;
109       static const SolvAttr updateReferenceTitle;
110       //@}
111
112       /** \name pattern */
113       //@{
114       static const SolvAttr isvisible;
115       static const SolvAttr icon;
116       static const SolvAttr order;
117       static const SolvAttr isdefault;
118       static const SolvAttr category;
119       static const SolvAttr script;
120       static const SolvAttr includes;
121       static const SolvAttr extends;
122       //@}
123
124       /** \name product */
125       //@{
126       static const SolvAttr productShortlabel;
127       static const SolvAttr productDistproduct;
128       static const SolvAttr productDistversion;
129       static const SolvAttr productType;
130       static const SolvAttr productFlags;
131       static const SolvAttr productFlavor;
132       static const SolvAttr productUpdaterepoKey;
133       static const SolvAttr productRegisterTarget;
134       static const SolvAttr productRegisterRelease;
135       static const SolvAttr productUrl;
136       static const SolvAttr productUrlType;
137
138       //@}
139
140       /** \name repository */
141       //@{
142       static const SolvAttr repositoryTimestamp;
143       static const SolvAttr repositoryExpire;
144       static const SolvAttr repositoryUpdates;
145       static const SolvAttr repositoryKeywords;
146       static const SolvAttr repositoryProducts;
147
148       //@}
149
150       //@}
151     public:
152       /** Default ctor: \ref noAttr */
153       SolvAttr() {}
154
155       /** Ctor taking kind as string. */
156       explicit SolvAttr( sat::detail::IdType id_r )  : _str( id_r ) {}
157       explicit SolvAttr( const IdString & idstr_r )  : _str( idstr_r ) {}
158       explicit SolvAttr( const std::string & str_r ) : _str( str_r ) {}
159       explicit SolvAttr( const char * cstr_r )       : _str( cstr_r ) {}
160
161     private:
162       friend class IdStringType<SolvAttr>;
163       IdString _str;
164   };
165
166   /////////////////////////////////////////////////////////////////
167 } // namespace sat
168 } // namespace zypp
169 ///////////////////////////////////////////////////////////////////
170 #endif // ZYPP_SolvAttr_H