libzypp 9.41.1

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   //
00057   class ZConfig : private base::NonCopyable
00058   {
00059     public:
00060 
00062       static ZConfig & instance();
00063 
00065       std::ostream & about( std::ostream & str ) const;
00066 
00067     public:
00068 
00072       Pathname systemRoot() const;
00073 
00074     public:
00075 
00077       static Arch defaultSystemArchitecture();
00078 
00080       Arch systemArchitecture() const;
00081 
00088       void setSystemArchitecture( const Arch & arch_r );
00089 
00091       void resetSystemArchitecture()
00092       { setSystemArchitecture( defaultSystemArchitecture() ); }
00093 
00094     public:
00097       static Locale defaultTextLocale();
00098 
00101       Locale textLocale() const;
00102 
00104       void setTextLocale( const Locale & locale_r );
00105 
00107       void resetTextLocale()
00108       { setTextLocale( defaultTextLocale() ); }
00109 
00110     public:
00116       bool hasUserData() const;
00117 
00119       std::string userData() const;
00120 
00125       bool setUserData( const std::string & str_r );
00127 
00128     public:
00133       Pathname repoCachePath() const;
00134 
00139       Pathname repoMetadataPath() const;
00140 
00145       Pathname repoSolvfilesPath() const;
00146 
00151       Pathname repoPackagesPath() const;
00152 
00157       Pathname configPath() const;
00158 
00163       Pathname knownReposPath() const;
00164 
00169       Pathname knownServicesPath() const;
00170 
00176       bool repo_add_probe() const;
00177 
00181       unsigned repo_refresh_delay() const;
00182 
00188       bool repoLabelIsAlias() const;
00189 
00197       void repoLabelIsAlias( bool yesno_r );
00198 
00202       long download_max_concurrent_connections() const;
00203 
00208       long download_min_download_speed() const;
00209 
00213       long download_max_download_speed() const;
00214 
00218       long download_max_silent_tries() const;
00219 
00223       long download_transfer_timeout() const;
00224 
00225 
00229       bool download_use_deltarpm() const;
00230 
00235       bool download_use_deltarpm_always() const;
00236 
00241       bool download_media_prefer_download() const;
00243       bool download_media_prefer_volatile() const
00244       { return ! download_media_prefer_download(); }
00248       void set_download_media_prefer_download( bool yesno_r );
00252       void set_default_download_media_prefer_download();
00253 
00257       DownloadMode commit_downloadMode() const;
00258 
00263       Pathname vendorPath() const;
00264 
00268       bool solver_onlyRequires() const;
00269 
00274       Pathname solver_checkSystemFile() const;
00275 
00279       bool solver_allowVendorChange() const;
00280 
00284       bool solver_cleandepsOnRemove() const;
00285 
00293       unsigned solver_upgradeTestcasesToKeep() const;
00294 
00308       bool solverUpgradeRemoveDroppedPackages() const;
00310       void setSolverUpgradeRemoveDroppedPackages( bool val_r );
00312       void resetSolverUpgradeRemoveDroppedPackages();
00313 
00320       const std::set<std::string> & multiversionSpec() const;
00321       void addMultiversionSpec( const std::string & name_r );
00322       void removeMultiversionSpec( const std::string & name_r );
00324 
00329       Pathname locksFile() const;
00330 
00334       bool apply_locks_file() const;
00335 
00339       Pathname update_dataPath() const;
00340 
00345       Pathname update_scriptsPath() const;
00346 
00351       Pathname update_messagesPath() const;
00352 
00356       std::string updateMessagesNotify() const;
00358       void setUpdateMessagesNotify( const std::string & val_r );
00360       void resetUpdateMessagesNotify();
00362 
00371       target::rpm::RpmInstFlags rpmInstallFlags() const;
00373 
00380       Pathname historyLogFile() const;
00381 
00385       Pathname credentialsGlobalDir() const;
00386 
00390       Pathname credentialsGlobalFile() const;
00391 
00400       std::string distroverpkg() const;
00401 
00407       Pathname pluginsPath() const;
00408 
00410     public:
00411       class Impl;
00413       ~ZConfig();
00414     private:
00415       friend class Impl;
00417       ZConfig();
00419       RW_pointer<Impl, rw_pointer::Scoped<Impl> > _pimpl;
00420   };
00422 
00424 } // namespace zypp
00426 #endif // ZYPP_ZCONFIG_H