00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PALUDIS_GUARD_PALUDIS_NAME_HH
00021 #define PALUDIS_GUARD_PALUDIS_NAME_HH 1
00022
00023 #include <paludis/name-fwd.hh>
00024 #include <paludis/util/exception.hh>
00025 #include <paludis/util/instantiation_policy.hh>
00026 #include <paludis/util/validated.hh>
00027 #include <paludis/util/named_value.hh>
00028
00029 #include <string>
00030 #include <iosfwd>
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 namespace paludis
00043 {
00044 namespace n
00045 {
00046 struct category;
00047 struct package;
00048 }
00049
00050
00051
00052
00053
00054
00055
00056
00057 class PALUDIS_VISIBLE PackageNamePartError :
00058 public NameError
00059 {
00060 public:
00061
00062
00063
00064 PackageNamePartError(const std::string & name) throw ();
00065 };
00066
00067
00068
00069
00070
00071
00072
00073 struct PALUDIS_VISIBLE PackageNamePartValidator :
00074 private InstantiationPolicy<PackageNamePartValidator, instantiation_method::NonInstantiableTag>
00075 {
00076
00077
00078
00079
00080 static void validate(const std::string &);
00081 };
00082
00083
00084
00085
00086
00087
00088
00089
00090 class PALUDIS_VISIBLE CategoryNamePartError :
00091 public NameError
00092 {
00093 public:
00094
00095
00096
00097 CategoryNamePartError(const std::string & name) throw ();
00098 };
00099
00100
00101
00102
00103
00104
00105
00106 struct PALUDIS_VISIBLE CategoryNamePartValidator :
00107 private InstantiationPolicy<CategoryNamePartValidator, instantiation_method::NonInstantiableTag>
00108 {
00109
00110
00111
00112
00113 static void validate(const std::string &);
00114 };
00115
00116
00117
00118
00119
00120
00121
00122 struct PALUDIS_VISIBLE QualifiedPackageName :
00123 relational_operators::HasRelationalOperators
00124 {
00125 NamedValue<n::category, CategoryNamePart> category;
00126 NamedValue<n::package, PackageNamePart> package;
00127
00128 QualifiedPackageName(const CategoryNamePart &, const PackageNamePart &);
00129 explicit QualifiedPackageName(const std::string &);
00130
00131 std::size_t hash() const PALUDIS_ATTRIBUTE((warn_unused_result));
00132
00133 bool operator< (const QualifiedPackageName &) const PALUDIS_ATTRIBUTE((warn_unused_result));
00134 bool operator== (const QualifiedPackageName &) const PALUDIS_ATTRIBUTE((warn_unused_result));
00135 };
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145 class PALUDIS_VISIBLE QualifiedPackageNameError : public NameError
00146 {
00147 public:
00148
00149
00150
00151 QualifiedPackageNameError(const std::string &) throw ();
00152 };
00153
00154 inline const QualifiedPackageName
00155 operator+ (const CategoryNamePart & c, const PackageNamePart & p)
00156 {
00157 return QualifiedPackageName(c, p);
00158 }
00159
00160
00161
00162
00163
00164
00165
00166
00167 class PALUDIS_VISIBLE SlotNameError : public NameError
00168 {
00169 public:
00170
00171
00172
00173 SlotNameError(const std::string & name) throw ();
00174 };
00175
00176
00177
00178
00179
00180
00181
00182 struct PALUDIS_VISIBLE SlotNameValidator :
00183 private InstantiationPolicy<SlotNameValidator, instantiation_method::NonInstantiableTag>
00184 {
00185
00186
00187
00188
00189 static void validate(const std::string &);
00190 };
00191
00192
00193
00194
00195
00196
00197
00198
00199 class PALUDIS_VISIBLE RepositoryNameError : public NameError
00200 {
00201 public:
00202
00203
00204
00205 RepositoryNameError(const std::string & name) throw ();
00206 };
00207
00208
00209
00210
00211
00212
00213
00214 struct PALUDIS_VISIBLE RepositoryNameValidator :
00215 private InstantiationPolicy<RepositoryNameValidator, instantiation_method::NonInstantiableTag>
00216 {
00217
00218
00219
00220
00221 static void validate(const std::string &);
00222 };
00223
00224
00225
00226
00227
00228
00229 struct PALUDIS_VISIBLE RepositoryNameComparator
00230 {
00231
00232
00233
00234 bool operator() (const RepositoryName & lhs, const RepositoryName & rhs) const
00235 {
00236 return lhs.data() < rhs.data();
00237 }
00238 };
00239
00240
00241
00242
00243
00244
00245
00246 struct PALUDIS_VISIBLE KeywordNameValidator :
00247 private InstantiationPolicy<KeywordNameValidator, instantiation_method::NonInstantiableTag>
00248 {
00249
00250
00251
00252
00253 static void validate(const std::string &);
00254 };
00255
00256
00257
00258
00259
00260
00261
00262
00263 class PALUDIS_VISIBLE KeywordNameError : public NameError
00264 {
00265 public:
00266
00267
00268
00269 KeywordNameError(const std::string & name) throw ();
00270 };
00271
00272
00273
00274
00275
00276
00277
00278 class PALUDIS_VISIBLE KeywordNameComparator
00279 {
00280 public:
00281
00282
00283
00284 bool operator() (const std::string &, const std::string &) const;
00285 };
00286
00287
00288
00289
00290
00291
00292
00293 struct PALUDIS_VISIBLE SetNameValidator :
00294 private InstantiationPolicy<SetNameValidator, instantiation_method::NonInstantiableTag>
00295 {
00296
00297
00298
00299
00300 static void validate(const std::string &);
00301 };
00302
00303
00304
00305
00306
00307
00308
00309
00310 class PALUDIS_VISIBLE SetNameError : public NameError
00311 {
00312 public:
00313
00314
00315
00316 SetNameError(const std::string & name) throw ();
00317 };
00318 }
00319
00320 #endif