libzypp  17.34.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/APIConfig.h>
20 #include <zypp/base/NonCopyable.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 
33 namespace zypp
34 {
35 
36  class RepoManager;
37 
39  //
40  // CLASS NAME : ZConfig
41  //
64  {
65  public:
66 
68  static ZConfig & instance();
69 
71  std::ostream & about( std::ostream & str ) const;
72 
73  public:
74 
78  Pathname systemRoot() const;
79 
83  Pathname repoManagerRoot() const;
84 
88  void setRepoManagerRoot ( const Pathname &root );
89 
90  public:
91 
93  static Arch defaultSystemArchitecture();
94 
96  Arch systemArchitecture() const;
97 
104  void setSystemArchitecture( const Arch & arch_r );
105 
108  { setSystemArchitecture( defaultSystemArchitecture() ); }
109 
110  public:
113  static Locale defaultTextLocale();
114 
117  Locale textLocale() const;
118 
120  void setTextLocale( const Locale & locale_r );
121 
124  { setTextLocale( defaultTextLocale() ); }
125 
126  public:
132  bool hasUserData() const;
133 
135  std::string userData() const;
136 
141  bool setUserData( const std::string & str_r );
143 
144  public:
149  Pathname repoCachePath() const;
150 
154  void setRepoCachePath ( const Pathname &path_r );
155 
159  Pathname pubkeyCachePath() const;
160 
165  Pathname repoMetadataPath() const;
166 
167 
171  void setRepoMetadataPath ( const Pathname &path_r );
172 
177  Pathname repoSolvfilesPath() const;
178 
182  void setRepoSolvfilesPath ( const Pathname &path_r );
183 
188  Pathname repoPackagesPath() const;
189 
190 
194  void setRepoPackagesPath ( const Pathname &path_r );
195 
200  Pathname configPath() const;
201 
206  Pathname knownReposPath() const;
207 
212  Pathname knownServicesPath() const;
213 
218  Pathname needrebootFile() const;
219 
224  Pathname needrebootPath() const;
225 
229  void setGeoipEnabled( bool enable = true );
230 
234  bool geoipEnabled () const;
235 
239  Pathname geoipCachePath() const;
240 
246  const std::vector<std::string> geoipHostnames () const;
247 
253  Pathname varsPath() const;
254 
260  bool repo_add_probe() const;
261 
265  unsigned repo_refresh_delay() const;
266 
270  LocaleSet repoRefreshLocales() const;
271 
277  bool repoLabelIsAlias() const;
278 
286  void repoLabelIsAlias( bool yesno_r );
287 
291  long download_max_concurrent_connections() const;
292 
297  long download_min_download_speed() const;
298 
302  long download_max_download_speed() const;
303 
307  long download_max_silent_tries() const;
308 
312  long download_transfer_timeout() const;
313 
314 
318  bool download_use_deltarpm() const;
319 
324  bool download_use_deltarpm_always() const;
325 
330  bool download_media_prefer_download() const;
333  { return ! download_media_prefer_download(); }
337  void set_download_media_prefer_download( bool yesno_r );
341  void set_default_download_media_prefer_download();
342 
347  Pathname download_mediaMountdir() const;
349  void set_download_mediaMountdir( Pathname newval_r );
351  void set_default_download_mediaMountdir();
352 
356  DownloadMode commit_downloadMode() const;
357 
371  bool gpgCheck() const;
372  TriBool repoGpgCheck() const;
373  TriBool pkgGpgCheck() const;
374 
375  void setGpgCheck( bool val_r );
376  void setRepoGpgCheck( TriBool val_r );
377  void setPkgGpgCheck( TriBool val_r );
378 
379  void resetGpgCheck();
380  void resetRepoGpgCheck();
381  void resetPkgGpgCheck();
382 
383  //
388  Pathname vendorPath() const;
389 
393  ResolverFocus solver_focus() const;
394 
398  bool solver_onlyRequires() const;
399 
404  Pathname solver_checkSystemFile() const;
405 
411  Pathname solver_checkSystemFileDir() const;
412 
416  bool solver_allowVendorChange() const;
417 
419  bool solver_dupAllowDowngrade() const;
420 
422  bool solver_dupAllowNameChange() const;
423 
425  bool solver_dupAllowArchChange() const;
426 
428  bool solver_dupAllowVendorChange() const;
429 
433  bool solver_cleandepsOnRemove() const;
434 
442  unsigned solver_upgradeTestcasesToKeep() const;
443 
457  bool solverUpgradeRemoveDroppedPackages() const;
459  void setSolverUpgradeRemoveDroppedPackages( bool val_r );
461  void resetSolverUpgradeRemoveDroppedPackages();
462 
473  const std::set<std::string> & multiversionSpec() const;
474  void multiversionSpec( std::set<std::string> new_r );
475  void clearMultiversionSpec();
476  void addMultiversionSpec( const std::string & name_r );
477  void removeMultiversionSpec( const std::string & name_r );
479 
484  Pathname locksFile() const;
485 
489  bool apply_locks_file() const;
490 
494  Pathname update_dataPath() const;
495 
500  Pathname update_scriptsPath() const;
501 
506  Pathname update_messagesPath() const;
507 
511  std::string updateMessagesNotify() const;
513  void setUpdateMessagesNotify( const std::string & val_r );
515  void resetUpdateMessagesNotify();
517 
526  target::rpm::RpmInstFlags rpmInstallFlags() const;
528 
535  Pathname historyLogFile() const;
536 
540  Pathname credentialsGlobalDir() const;
541 
545  Pathname credentialsGlobalFile() const;
546 
555  std::string distroverpkg() const;
556 
562  Pathname pluginsPath() const;
563 
567  std::string multiversionKernels() const;
568 
570 
571  public:
572  class Impl;
573 
574  ZConfig(const ZConfig &) = delete;
575  ZConfig(ZConfig &&) = delete;
576  ZConfig &operator=(const ZConfig &) = delete;
577  ZConfig &operator=(ZConfig &&) = delete;
578 
580  ~ZConfig();
581  void notifyTargetChanged();
582 
583  private:
584  friend class RepoManager;
585  friend class RepoManagerBaseImpl;
587  Pathname builtinRepoCachePath() const;
589  Pathname builtinRepoMetadataPath() const;
591  Pathname builtinRepoSolvfilesPath() const;
593  Pathname builtinRepoPackagesPath() const;
594 
595  private:
596  friend class Impl;
598  ZConfig();
601  };
603 
605 } // namespace zypp
607 #endif // ZYPP_ZCONFIG_H
boost::logic::tribool TriBool
3-state boolean logic (true, false and indeterminate).
Definition: String.h:30
void resetSystemArchitecture()
Reset the zypp system architecture to the default.
Definition: ZConfig.h:107
Architecture.
Definition: Arch.h:36
ResolverFocus
The resolver&#39;s general attitude.
Definition: ResolverFocus.h:23
std::unordered_set< Locale > LocaleSet
Definition: Locale.h:29
String related utilities and Regular expression matching.
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Definition: ZConfig.h:600
ZConfig implementation.
Definition: ZConfig.cc:405
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition: ResTraits.h:93
Interim helper class to collect global options and settings.
Definition: ZConfig.h:63
&#39;Language[_Country]&#39; codes.
Definition: Locale.h:50
bool download_media_prefer_volatile() const
Definition: ZConfig.h:332
Wrapper for const correct access via Smart pointer types.
Definition: PtrTypes.h:292
void resetTextLocale()
Reset the locale for translated texts to the default.
Definition: ZConfig.h:123
Easy-to use interface to the ZYPP dependency resolver.
Definition: Application.cc:19
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
DownloadMode
Supported commit download policies.
Definition: DownloadMode.h:24