libzypp 17.35.16
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
89
93 void setRepoManagerRoot ( const Pathname &root );
94
95 public:
96
99
101 Arch systemArchitecture() const;
102
109 void setSystemArchitecture( const Arch & arch_r );
110
114
115 public:
118 static Locale defaultTextLocale();
119
122 Locale textLocale() const;
123
125 void setTextLocale( const Locale & locale_r );
126
130
131 public:
136
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;
339
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
496#if LEGACY(1735)
500 Pathname update_dataPath() const;
501
505 Pathname update_scriptsPath() const;
506
510 Pathname update_messagesPath() const;
511#else
515 static Pathname update_dataPath();
516
520 static Pathname update_scriptsPath();
521
525 static Pathname update_messagesPath();
526#endif
527
530
531 std::string updateMessagesNotify() const;
533 void setUpdateMessagesNotify( const std::string & val_r );
535 void resetUpdateMessagesNotify();
537
540
546 target::rpm::RpmInstFlags rpmInstallFlags() const;
548
555 Pathname historyLogFile() const;
556
560 Pathname credentialsGlobalDir() const;
561
565 Pathname credentialsGlobalFile() const;
566
575 std::string distroverpkg() const;
576
579
582 Pathname pluginsPath() const;
583
587 std::string multiversionKernels() const;
588
590
591 public:
592 class Impl;
593
594 ZConfig(const ZConfig &) = delete;
595 ZConfig(ZConfig &&) = delete;
596 ZConfig &operator=(const ZConfig &) = delete;
597 ZConfig &operator=(ZConfig &&) = delete;
598
600 ~ZConfig();
601 void notifyTargetChanged();
602
603 private:
604 friend class RepoManager;
605 template<typename T> friend class zyppng::RepoManager;
614
615 private:
616 friend class Impl;
618 ZConfig();
621 };
622
623
625} // namespace zypp
627#endif // ZYPP_ZCONFIG_H
Architecture.
Definition Arch.h:37
'Language[_Country]' codes.
Definition Locale.h:51
ZConfig implementation.
Definition ZConfig.cc:406
Arch systemArchitecture() const
The system architecture zypp uses.
Definition ZConfig.cc:977
ZConfig(const ZConfig &)=delete
Pathname builtinRepoSolvfilesPath() const
The builtin config file value.
Definition ZConfig.cc:1097
Pathname repoManagerRoot() const
The RepoManager root directory.
Definition ZConfig.cc:956
void resetSystemArchitecture()
Reset the zypp system architecture to the default.
Definition ZConfig.h:112
void setRepoManagerRoot(const Pathname &root)
Sets the RepoManager root directory.
Definition ZConfig.cc:962
void setTextLocale(const Locale &locale_r)
Set the preferred locale for translated texts.
Definition ZConfig.cc:1004
void notifyTargetChanged()
internal
Definition ZConfig.cc:950
static Locale defaultTextLocale()
The autodetected preferred locale for translated texts.
Definition ZConfig.cc:995
Pathname systemRoot() const
The target root directory.
Definition ZConfig.cc:953
ZConfig & operator=(ZConfig &&)=delete
ZConfig(ZConfig &&)=delete
RW_pointer< Impl, rw_pointer::Scoped< Impl > > _pimpl
Pointer to implementation.
Definition ZConfig.h:620
void setSystemArchitecture(const Arch &arch_r)
Override the zypp system architecture.
Definition ZConfig.cc:980
static ZConfig & instance()
Singleton ctor.
Definition ZConfig.cc:925
std::ostream & about(std::ostream &str) const
Print some detail about the current libzypp version.
Definition ZConfig.cc:1340
Pathname builtinRepoCachePath() const
The builtin config file value.
Definition ZConfig.cc:1091
Pathname builtinRepoPackagesPath() const
The builtin config file value.
Definition ZConfig.cc:1100
Pathname builtinRepoMetadataPath() const
The builtin config file value.
Definition ZConfig.cc:1094
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
friend class RepoManager
Definition ZConfig.h:604
void resetTextLocale()
Reset the locale for translated texts to the default.
Definition ZConfig.h:128
static Arch defaultSystemArchitecture()
The autodetected system architecture.
Definition ZConfig.cc:971
bool download_media_prefer_download() const
Hint which media to prefer when installing packages (download vs.
Definition ZConfig.cc:1182
The RepoManager class Provides knowledge and methods to maintain repo settings and metadata for a giv...
Definition ZConfig.h:34
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.
Wrapper for const correct access via Smart pointer types.
Definition PtrTypes.h:293
Provides API related macros.