libzypp
10.5.0
|
00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef ZYPP_ZYPP_H 00013 #define ZYPP_ZYPP_H 00014 00015 #include <iosfwd> 00016 00017 #include "zypp/base/ReferenceCounted.h" 00018 #include "zypp/base/NonCopyable.h" 00019 #include "zypp/base/PtrTypes.h" 00020 #include "zypp/base/Deprecated.h" 00021 00022 #include "zypp/ZConfig.h" 00023 00024 #include "zypp/ZYppCommit.h" 00025 #include "zypp/ResTraits.h" 00026 00027 #include "zypp/Target.h" 00028 #include "zypp/Resolver.h" 00029 #include "zypp/KeyRing.h" 00030 #include "zypp/DiskUsageCounter.h" 00031 00033 namespace zypp 00034 { 00035 00036 namespace zypp_detail 00037 { 00038 class ZYppImpl; 00039 } 00040 00041 class ZYppFactory; 00042 class ResPool; 00043 class ResPoolProxy; 00044 class KeyRing; 00045 00047 // 00048 // CLASS NAME : ZYpp 00049 // 00054 class ZYpp : public base::ReferenceCounted, private base::NonCopyable 00055 { 00056 public: 00057 00058 typedef intrusive_ptr<ZYpp> Ptr; 00059 typedef intrusive_ptr<const ZYpp> constPtr; 00060 00061 public: 00062 00067 ResPool pool() const; 00068 00073 ResPoolProxy poolProxy() const; 00074 00075 DiskUsageCounter::MountPointSet diskUsage(); 00076 00077 void setPartitions(const DiskUsageCounter::MountPointSet &mp); 00078 00079 DiskUsageCounter::MountPointSet getPartitions() const; 00080 00081 public: 00085 Target_Ptr target() const; 00086 00090 Target_Ptr getTarget() const; 00091 00098 void initializeTarget(const Pathname & root, bool doRebuild_r = false); 00099 00103 void finishTarget(); 00104 00105 00106 public: 00107 typedef ZYppCommitResult CommitResult; 00108 00114 ZYppCommitResult commit( const ZYppCommitPolicy & policy_r ); 00115 00119 void installSrcPackage( const SrcPackage_constPtr & srcPackage_r ); 00120 00121 public: 00123 Resolver_Ptr resolver() const; 00124 KeyRing_Ptr keyRing() const; 00125 public: 00130 ZYPP_DEPRECATED void setTextLocale( const Locale & textLocale_r ) 00131 { ZConfig::instance().setTextLocale( textLocale_r ); } 00133 ZYPP_DEPRECATED Locale getTextLocale() const 00134 { return ZConfig::instance().textLocale(); } 00135 00136 public: 00148 void setRequestedLocales( const LocaleSet & locales_r ) ZYPP_DEPRECATED; 00149 00151 const LocaleSet & getRequestedLocales() const ZYPP_DEPRECATED; 00152 00159 const LocaleSet & getAvailableLocales() const ZYPP_DEPRECATED; 00161 00162 public: 00164 Pathname homePath() const; 00165 00167 Pathname tmpPath() const; 00168 00170 void setHomePath( const Pathname & path ); 00171 00175 ZYPP_DEPRECATED Arch architecture() const 00176 { return ZConfig::instance().systemArchitecture(); } 00182 ZYPP_DEPRECATED void setArchitecture( const Arch & arch ) 00183 { ZConfig::instance().setSystemArchitecture( arch ); } 00184 00185 public: 00186 00191 ZYPP_DEPRECATED int applyLocks() 00192 { return 0; } 00193 00194 protected: 00196 virtual ~ZYpp(); 00198 virtual std::ostream & dumpOn( std::ostream & str ) const; 00199 private: 00201 friend class ZYppFactory; 00202 00204 typedef zypp_detail::ZYppImpl Impl; 00205 typedef shared_ptr<Impl> Impl_Ptr; 00207 explicit 00208 ZYpp( const Impl_Ptr & impl_r ); 00209 private: 00211 RW_pointer<Impl> _pimpl; 00212 }; 00214 00216 } // namespace zypp 00218 #endif // ZYPP_ZYPP_H