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: 00115 Pathname repoCachePath() const; 00116 00121 Pathname repoMetadataPath() const; 00122 00127 Pathname repoSolvfilesPath() const; 00128 00133 Pathname repoPackagesPath() const; 00134 00139 Pathname configPath() const; 00140 00145 Pathname knownReposPath() const; 00146 00151 Pathname knownServicesPath() const; 00152 00158 bool repo_add_probe() const; 00159 00163 unsigned repo_refresh_delay() const; 00164 00170 bool repoLabelIsAlias() const; 00171 00179 void repoLabelIsAlias( bool yesno_r ); 00180 00184 long download_max_concurrent_connections() const; 00185 00190 long download_min_download_speed() const; 00191 00195 long download_max_download_speed() const; 00196 00200 long download_max_silent_tries() const; 00201 00205 long download_transfer_timeout() const; 00206 00207 00211 bool download_use_deltarpm() const; 00212 00217 bool download_use_deltarpm_always() const; 00218 00223 bool download_media_prefer_download() const; 00225 bool download_media_prefer_volatile() const 00226 { return ! download_media_prefer_download(); } 00230 void set_download_media_prefer_download( bool yesno_r ); 00234 void set_default_download_media_prefer_download(); 00235 00239 DownloadMode commit_downloadMode() const; 00240 00245 Pathname vendorPath() const; 00246 00250 bool solver_onlyRequires() const; 00251 00256 Pathname solver_checkSystemFile() const; 00257 00261 bool solver_allowVendorChange() const; 00262 00266 bool solver_cleandepsOnRemove() const; 00267 00275 unsigned solver_upgradeTestcasesToKeep() const; 00276 00290 bool solverUpgradeRemoveDroppedPackages() const; 00292 void setSolverUpgradeRemoveDroppedPackages( bool val_r ); 00294 void resetSolverUpgradeRemoveDroppedPackages(); 00295 00302 const std::set<std::string> & multiversionSpec() const; 00303 void addMultiversionSpec( const std::string & name_r ); 00304 void removeMultiversionSpec( const std::string & name_r ); 00306 00311 Pathname locksFile() const; 00312 00316 bool apply_locks_file() const; 00317 00321 Pathname update_dataPath() const; 00322 00327 Pathname update_scriptsPath() const; 00328 00333 Pathname update_messagesPath() const; 00334 00338 std::string updateMessagesNotify() const; 00340 void setUpdateMessagesNotify( const std::string & val_r ); 00342 void resetUpdateMessagesNotify(); 00344 00353 target::rpm::RpmInstFlags rpmInstallFlags() const; 00355 00362 Pathname historyLogFile() const; 00363 00367 Pathname credentialsGlobalDir() const; 00368 00372 Pathname credentialsGlobalFile() const; 00373 00382 std::string distroverpkg() const; 00383 00389 Pathname pluginsPath() const; 00390 00392 public: 00393 class Impl; 00395 ~ZConfig(); 00396 private: 00397 friend class Impl; 00399 ZConfig(); 00401 RW_pointer<Impl, rw_pointer::Scoped<Impl> > _pimpl; 00402 }; 00404 00406 } // namespace zypp 00408 #endif // ZYPP_ZCONFIG_H