libzypp  10.5.0
ZConfig.h
Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #ifndef ZYPP_ZCONFIG_H
00013 #define ZYPP_ZCONFIG_H
00014 
00015 #include <iosfwd>
00016 #include <set>
00017 #include <string>
00018 
00019 #include "zypp/base/Deprecated.h"
00020 #include "zypp/base/NonCopyable.h"
00021 #include "zypp/base/PtrTypes.h"
00022 
00023 #include "zypp/Arch.h"
00024 #include "zypp/Locale.h"
00025 #include "zypp/Pathname.h"
00026 #include "zypp/IdString.h"
00027 
00028 #include "zypp/DownloadMode.h"
00029 #include "zypp/target/rpm/RpmFlags.h"
00030 
00032 namespace zypp
00033 { 
00034 
00036   //
00037   //    CLASS NAME : ZConfig
00038   //
00058   class ZConfig : private base::NonCopyable
00059   {
00060     public:
00061 
00063       static ZConfig & instance();
00064 
00066       std::ostream & about( std::ostream & str ) const;
00067 
00068     public:
00069 
00073       Pathname systemRoot() const;
00074 
00075     public:
00076 
00078       static Arch defaultSystemArchitecture();
00079 
00081       Arch systemArchitecture() const;
00082 
00089       void setSystemArchitecture( const Arch & arch_r );
00090 
00092       void resetSystemArchitecture()
00093       { setSystemArchitecture( defaultSystemArchitecture() ); }
00094 
00095     public:
00098       static Locale defaultTextLocale();
00099 
00102       Locale textLocale() const;
00103 
00105       void setTextLocale( const Locale & locale_r );
00106 
00108       void resetTextLocale()
00109       { setTextLocale( defaultTextLocale() ); }
00110 
00111     public:
00116       Pathname repoCachePath() const;
00117 
00122       Pathname repoMetadataPath() const;
00123 
00128       Pathname repoSolvfilesPath() const;
00129 
00134       Pathname repoPackagesPath() const;
00135 
00140       Pathname configPath() const;
00141 
00146       Pathname knownReposPath() const;
00147 
00152       Pathname knownServicesPath() const;
00153 
00159       bool repo_add_probe() const;
00160 
00164       unsigned repo_refresh_delay() const;
00165 
00169       LocaleSet repoRefreshLocales() const;
00170 
00176       bool repoLabelIsAlias() const;
00177 
00185       void repoLabelIsAlias( bool yesno_r );
00186 
00190       long download_max_concurrent_connections() const;
00191 
00196       long download_min_download_speed() const;
00197 
00201       long download_max_download_speed() const;
00202 
00206       long download_max_silent_tries() const;
00207 
00211       long download_transfer_timeout() const;
00212 
00213 
00217       bool download_use_deltarpm() const;
00218 
00223       bool download_use_deltarpm_always() const;
00224 
00229       bool download_media_prefer_download() const;
00231       bool download_media_prefer_volatile() const
00232       { return ! download_media_prefer_download(); }
00236       void set_download_media_prefer_download( bool yesno_r );
00240       void set_default_download_media_prefer_download();
00241 
00245       DownloadMode commit_downloadMode() const;
00246 
00251       Pathname vendorPath() const;
00252 
00256       bool solver_onlyRequires() const;
00257 
00262       Pathname solver_checkSystemFile() const;
00263 
00267       bool solver_allowVendorChange() const;
00268 
00272       bool solver_cleandepsOnRemove() const;
00273 
00281       unsigned solver_upgradeTestcasesToKeep() const;
00282 
00296       bool solverUpgradeRemoveDroppedPackages() const;
00298       void setSolverUpgradeRemoveDroppedPackages( bool val_r );
00300       void resetSolverUpgradeRemoveDroppedPackages();
00301 
00308       const std::set<std::string> & multiversionSpec() const;
00309       void addMultiversionSpec( const std::string & name_r );
00310       void removeMultiversionSpec( const std::string & name_r );
00312 
00317       Pathname locksFile() const;
00318 
00322       bool apply_locks_file() const;
00323 
00327       Pathname update_dataPath() const;
00328 
00333       Pathname update_scriptsPath() const;
00334 
00339       Pathname update_messagesPath() const;
00340 
00344       std::string updateMessagesNotify() const;
00346       void setUpdateMessagesNotify( const std::string & val_r );
00348       void resetUpdateMessagesNotify();
00350 
00359       target::rpm::RpmInstFlags rpmInstallFlags() const;
00361 
00368       Pathname historyLogFile() const;
00369 
00373       Pathname credentialsGlobalDir() const;
00374 
00378       Pathname credentialsGlobalFile() const;
00379 
00388       std::string distroverpkg() const;
00389 
00395       Pathname pluginsPath() const;
00396 
00398     public:
00399       class Impl;
00401       ~ZConfig();
00402     private:
00403       friend class Impl;
00405       ZConfig();
00407       RW_pointer<Impl, rw_pointer::Scoped<Impl> > _pimpl;
00408   };
00410 
00412 } // namespace zypp
00414 #endif // ZYPP_ZCONFIG_H