libzypp 17.35.1
ZConfig.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_ZCONFIG_H
13#define ZYPP_ZCONFIG_H
14
15#include <iosfwd>
16#include <set>
17#include <string>
18
19#include <zypp-core/Globals.h>
21#include <zypp/base/PtrTypes.h>
22
23#include <zypp/Arch.h>
24#include <zypp/Locale.h>
25#include <zypp/Pathname.h>
26#include <zypp/IdString.h>
27#include <zypp/TriBool.h>
28#include <zypp/ResolverFocus.h>
29#include <zypp/DownloadMode.h>
31
32namespace zyppng {
33 // just for the friend declaration
34 template<typename T> class RepoManager;
35}
36
38namespace zypp
39{
40
41 class RepoManager;
42
44 //
45 // CLASS NAME : ZConfig
46 //
69 {
70 public:
71
73 static ZConfig & instance();
74
76 std::ostream & about( std::ostream & str ) const;
77
78 public:
79
83 Pathname systemRoot() const;
84
88 Pathname repoManagerRoot() const;
89
93 void setRepoManagerRoot ( const Pathname &root );
94
95 public:
96
98 static Arch defaultSystemArchitecture();
99
101 Arch systemArchitecture() const;
102
109 void setSystemArchitecture( const Arch & arch_r );
110
113 { setSystemArchitecture( defaultSystemArchitecture() ); }
114
115 public:
118 static Locale defaultTextLocale();
119
122 Locale textLocale() const;
123
125 void setTextLocale( const Locale & locale_r );
126
129 { setTextLocale( defaultTextLocale() ); }
130
131 public:
137 bool hasUserData() const;
138
140 std::string userData() const;
141
146 bool setUserData( const std::string & str_r );
148
149 public:
154 Pathname repoCachePath() const;
155
159 void setRepoCachePath ( const Pathname &path_r );
160
164 Pathname pubkeyCachePath() const;
165
170 Pathname repoMetadataPath() const;
171
172
176 void setRepoMetadataPath ( const Pathname &path_r );
177
182 Pathname repoSolvfilesPath() const;
183
187 void setRepoSolvfilesPath ( const Pathname &path_r );
188
193 Pathname repoPackagesPath() const;
194
195
199 void setRepoPackagesPath ( const Pathname &path_r );
200
205 Pathname configPath() const;
206
211 Pathname knownReposPath() const;
212
217 Pathname knownServicesPath() const;
218
223 Pathname needrebootFile() const;
224
229 Pathname needrebootPath() const;
230
234 void setGeoipEnabled( bool enable = true );
235
239 bool geoipEnabled () const;
240
244 Pathname geoipCachePath() const;
245
251 const std::vector<std::string> geoipHostnames () const;
252
258 Pathname varsPath() const;
259
265 bool repo_add_probe() const;
266
270 unsigned repo_refresh_delay() const;
271
275 LocaleSet repoRefreshLocales() const;
276
282 bool repoLabelIsAlias() const;
283
291 void repoLabelIsAlias( bool yesno_r );
292
296 long download_max_concurrent_connections() const;
297
302 long download_min_download_speed() const;
303
307 long download_max_download_speed() const;
308
312 long download_max_silent_tries() const;
313
317 long download_transfer_timeout() const;
318
319
323 bool download_use_deltarpm() const;
324
329 bool download_use_deltarpm_always() const;
330
335 bool download_media_prefer_download() const;
338 { return ! download_media_prefer_download(); }
342 void set_download_media_prefer_download( bool yesno_r );
346 void set_default_download_media_prefer_download();
347
352 Pathname download_mediaMountdir() const;
354 void set_download_mediaMountdir( Pathname newval_r );
356 void set_default_download_mediaMountdir();
357
361 DownloadMode commit_downloadMode() const;
362
376 bool gpgCheck() const;
377 TriBool repoGpgCheck() const;
378 TriBool pkgGpgCheck() const;
379
380 void setGpgCheck( bool val_r );
381 void setRepoGpgCheck( TriBool val_r );
382 void setPkgGpgCheck( TriBool val_r );
383
384 void resetGpgCheck();
385 void resetRepoGpgCheck();
386 void resetPkgGpgCheck();
388 //
393 Pathname vendorPath() const;
394
398 ResolverFocus solver_focus() const;
399
403 bool solver_onlyRequires() const;
404
409 Pathname solver_checkSystemFile() const;
410
416 Pathname solver_checkSystemFileDir() const;
417
421 bool solver_allowVendorChange() const;
422
424 bool solver_dupAllowDowngrade() const;
425
427 bool solver_dupAllowNameChange() const;
428
430 bool solver_dupAllowArchChange() const;
431
433 bool solver_dupAllowVendorChange() const;
434
438 bool solver_cleandepsOnRemove() const;
439
447 unsigned solver_upgradeTestcasesToKeep() const;
448
462 bool solverUpgradeRemoveDroppedPackages() const;
464 void setSolverUpgradeRemoveDroppedPackages( bool val_r );
466 void resetSolverUpgradeRemoveDroppedPackages();
467
478 const std::set<std::string> & multiversionSpec() const;
479 void multiversionSpec( std::set<std::string> new_r );
480 void clearMultiversionSpec();
481 void addMultiversionSpec( const std::string & name_r );
482 void removeMultiversionSpec( const std::string & name_r );
484
489 Pathname locksFile() const;
490
494 bool apply_locks_file() const;
495
499 Pathname update_dataPath() const;
500
505 Pathname update_scriptsPath() const;
506
511 Pathname update_messagesPath() const;
512
516 std::string updateMessagesNotify() const;
518 void setUpdateMessagesNotify( const std::string & val_r );
520 void resetUpdateMessagesNotify();
522
531 target::rpm::RpmInstFlags rpmInstallFlags() const;
533
540 Pathname historyLogFile() const;
541
545 Pathname credentialsGlobalDir() const;
546
550 Pathname credentialsGlobalFile() const;
551
560 std::string distroverpkg() const;
561
567 Pathname pluginsPath() const;
568
572 std::string multiversionKernels() const;
573
575
576 public:
577 class Impl;
578
579 ZConfig(const ZConfig &) = delete;
580 ZConfig(ZConfig &&) = delete;
581 ZConfig &operator=(const ZConfig &) = delete;
582 ZConfig &operator=(ZConfig &&) = delete;
583
585 ~ZConfig();
586 void notifyTargetChanged();
587
588 private:
589 friend class RepoManager;
590 template<typename T> friend class zyppng::RepoManager;
592 Pathname builtinRepoCachePath() const;
594 Pathname builtinRepoMetadataPath() const;
596 Pathname builtinRepoSolvfilesPath() const;
598 Pathname builtinRepoPackagesPath() const;
599
600 private:
601 friend class Impl;
603 ZConfig();
606 };
608
610} // namespace zypp
612#endif // ZYPP_ZCONFIG_H
RepoManager implementation.
Architecture.
Definition Arch.h:37
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Definition AutoDispose.h:95
'Language[_Country]' codes.
Definition Locale.h:51
ZConfig implementation.
Definition ZConfig.cc:406
Interim helper class to collect global options and settings.
Definition ZConfig.h:69
ZConfig(const ZConfig &)=delete
void resetSystemArchitecture()
Reset the zypp system architecture to the default.
Definition ZConfig.h:112
ZConfig & operator=(ZConfig &&)=delete
ZConfig(ZConfig &&)=delete
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Definition ZConfig.h:605
bool download_media_prefer_volatile() const
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition ZConfig.h:337
ZConfig & operator=(const ZConfig &)=delete
void resetTextLocale()
Reset the locale for translated texts to the default.
Definition ZConfig.h:128
The RepoManager class Provides knowledge and methods to maintain repo settings and metadata for a giv...
String related utilities and Regular expression matching.
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition NonCopyable.h:26
Easy-to use interface to the ZYPP dependency resolver.
std::unordered_set< Locale > LocaleSet
Definition Locale.h:29
ResolverFocus
The resolver's general attitude.
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition String.h:30
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
DownloadMode
Supported commit download policies.
creates and provides information about known sources.
Provides API related macros.