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 00021 #include "zypp/base/Deprecated.h" 00022 #include "zypp/ZYppCommit.h" 00023 #include "zypp/ResTraits.h" 00024 00025 #include "zypp/Target.h" 00026 #include "zypp/Resolver.h" 00027 #include "zypp/KeyRing.h" 00028 #include "zypp/DiskUsageCounter.h" 00029 00031 namespace zypp 00032 { 00033 00034 namespace zypp_detail 00035 { 00036 class ZYppImpl; 00037 } 00038 00039 class ZYppFactory; 00040 class ResPool; 00041 class ResPoolProxy; 00042 class ResStore; 00043 class Locale; 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 void addResolvables (const ResStore& store, bool installed = false); 00076 00077 void removeResolvables (const ResStore& store); 00078 00079 DiskUsageCounter::MountPointSet diskUsage(); 00080 00081 void setPartitions(const DiskUsageCounter::MountPointSet &mp); 00082 00083 DiskUsageCounter::MountPointSet getPartitions() const; 00084 00085 public: 00089 Target_Ptr target() const; 00090 00095 void initializeTarget(const Pathname & root); 00096 00101 ZYPP_DEPRECATED void initTarget(const Pathname & root, bool commit_only = false); 00102 00106 void finishTarget(); 00107 00108 00109 public: 00110 typedef ZYppCommitResult CommitResult; 00111 00117 ZYppCommitResult commit( const ZYppCommitPolicy & policy_r ); 00118 00122 void installSrcPackage( const SrcPackage_constPtr & srcPackage_r ); 00123 00124 public: 00126 Resolver_Ptr resolver() const; 00127 KeyRing_Ptr keyRing() const; 00128 public: 00132 void setTextLocale( const Locale & textLocale_r ); 00134 Locale getTextLocale() const; 00135 00136 public: 00137 typedef std::set<Locale> LocaleSet; 00144 void setRequestedLocales( const LocaleSet & locales_r ); 00146 LocaleSet getRequestedLocales() const; 00147 00153 LocaleSet getAvailableLocales() const; 00154 00158 void availableLocale( const Locale & locale_r ); 00159 00160 public: 00162 Pathname homePath() const; 00163 00165 Pathname tmpPath() const; 00166 00168 void setHomePath( const Pathname & path ); 00169 00171 Arch architecture() const; 00175 void setArchitecture( const Arch & arch ); 00176 00177 public: 00178 00185 int applyLocks(); 00186 00187 protected: 00189 virtual ~ZYpp(); 00191 virtual std::ostream & dumpOn( std::ostream & str ) const; 00192 private: 00194 friend class ZYppFactory; 00195 00197 typedef zypp_detail::ZYppImpl Impl; 00198 typedef shared_ptr<Impl> Impl_Ptr; 00200 explicit 00201 ZYpp( const Impl_Ptr & impl_r ); 00202 private: 00204 RW_pointer<Impl> _pimpl; 00205 }; 00207 00209 } // namespace zypp 00211 #endif // ZYPP_ZYPP_H
1.5.3