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 
00070       Pathname systemRoot() const;
00071 
00072     public:
00073 
00075       static Arch defaultSystemArchitecture();
00076 
00078       Arch systemArchitecture() const;
00079 
00086       void setSystemArchitecture( const Arch & arch_r );
00087 
00089       void resetSystemArchitecture()
00090       { setSystemArchitecture( defaultSystemArchitecture() ); }
00091 
00092     public:
00095       static Locale defaultTextLocale();
00096 
00099       Locale textLocale() const;
00100 
00102       void setTextLocale( const Locale & locale_r );
00103 
00105       void resetTextLocale()
00106       { setTextLocale( defaultTextLocale() ); }
00107 
00108     public:
00113       Pathname repoCachePath() const;
00114 
00119       Pathname repoMetadataPath() const;
00120 
00125       Pathname repoSolvfilesPath() const;
00126 
00131       Pathname repoPackagesPath() const;
00132 
00137       Pathname configPath() const;
00138 
00143       Pathname knownReposPath() const;
00144 
00149       Pathname knownServicesPath() const;
00150 
00156       bool repo_add_probe() const;
00157 
00161       unsigned repo_refresh_delay() const;
00162 
00168       bool repoLabelIsAlias() const;
00169 
00177       void repoLabelIsAlias( bool yesno_r );
00178 
00182       long download_max_concurrent_connections() const;
00183 
00188       long download_min_download_speed() const;
00189 
00193       long download_max_download_speed() const;
00194 
00198       long download_max_silent_tries() const;
00199 
00203       long download_transfer_timeout() const;
00204 
00205 
00209       bool download_use_deltarpm() const;
00210 
00215       bool download_use_deltarpm_always() const;
00216 
00221       bool download_media_prefer_download() const;
00223       bool download_media_prefer_volatile() const
00224       { return ! download_media_prefer_download(); }
00228       void set_download_media_prefer_download( bool yesno_r );
00232       void set_default_download_media_prefer_download();
00233 
00237       DownloadMode commit_downloadMode() const;
00238 
00243       Pathname vendorPath() const;
00244 
00248       bool solver_onlyRequires() const;
00249 
00254       Pathname solver_checkSystemFile() const;
00255 
00259       bool solver_allowVendorChange() const;
00260 
00268       unsigned solver_upgradeTestcasesToKeep() const;
00269 
00283       bool solverUpgradeRemoveDroppedPackages() const;
00285       void setSolverUpgradeRemoveDroppedPackages( bool val_r );
00287       void resetSolverUpgradeRemoveDroppedPackages();
00288 
00295       const std::set<std::string> & multiversionSpec() const;
00296       void addMultiversionSpec( const std::string & name_r );
00297       void removeMultiversionSpec( const std::string & name_r );
00299 
00304       Pathname locksFile() const;
00305 
00309       bool apply_locks_file() const;
00310 
00314       Pathname update_dataPath() const;
00315 
00320       Pathname update_scriptsPath() const;
00321 
00326       Pathname update_messagesPath() const;
00327 
00331       std::string updateMessagesNotify() const;
00333       void setUpdateMessagesNotify( const std::string & val_r );
00335       void resetUpdateMessagesNotify();
00337 
00346       target::rpm::RpmInstFlags rpmInstallFlags() const;
00348 
00355       Pathname historyLogFile() const;
00356 
00360       Pathname credentialsGlobalDir() const;
00361 
00365       Pathname credentialsGlobalFile() const;
00366 
00375       std::string distroverpkg() const;
00376 
00382       Pathname pluginsPath() const;
00383 
00385     public:
00386       class Impl;
00388       ~ZConfig();
00389     private:
00390       friend class Impl;
00392       ZConfig();
00394       RW_pointer<Impl, rw_pointer::Scoped<Impl> > _pimpl;
00395   };
00397 
00399 } // namespace zypp
00401 #endif // ZYPP_ZCONFIG_H

doxygen