00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef ZYPP_TARGET_H 00013 #define ZYPP_TARGET_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/ResStore.h" 00023 #include "zypp/Pathname.h" 00024 #include "zypp/ResPool.h" 00025 00027 namespace zypp 00028 { 00029 namespace target 00030 { 00031 class TargetImpl; 00032 namespace rpm { 00033 class RpmDb; 00034 } 00035 } 00036 namespace zypp_detail 00037 { 00038 class ZYppImpl; 00039 } 00040 00041 DEFINE_PTR_TYPE(Target); 00042 00044 // 00045 // CLASS NAME : Target 00046 // 00049 class Target : public base::ReferenceCounted, public base::NonCopyable 00050 { 00051 public: 00052 typedef target::TargetImpl Impl; 00053 typedef intrusive_ptr<Impl> Impl_Ptr; 00054 typedef std::list<PoolItem_Ref> PoolItemList; 00055 00056 public: 00057 00059 const ResStore & resolvables(); 00060 00062 static Target_Ptr nullimpl(); 00063 00065 target::rpm::RpmDb & rpmDb(); 00066 00069 bool providesFile (const std::string & name_str, const std::string & path_str) const; 00070 00071 ResObject::constPtr whoOwnsFile (const std::string & path_str) const; 00072 00077 void getResolvablesToInsDel ( const ResPool pool_r, 00078 PoolItemList & dellist_r, 00079 PoolItemList & instlist_r, 00080 PoolItemList & srclist_r ) const; 00081 00082 #ifndef STORAGE_DISABLED 00083 00084 bool isStorageEnabled() const; 00085 void enableStorage(const Pathname &root_r); 00086 #endif 00087 00089 bool setInstallationLogfile(const Pathname & path_r); 00090 00092 Pathname root() const; 00093 00094 public: 00096 explicit 00097 Target( const Pathname & root = "/" ); 00099 explicit 00100 Target( const Impl_Ptr & impl_r ); 00101 00102 private: 00103 friend std::ostream & operator<<( std::ostream & str, const Target & obj ); 00105 std::ostream & dumpOn( std::ostream & str ) const; 00106 00107 private: 00109 friend class zypp_detail::ZYppImpl; 00110 00112 RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl; 00113 00114 static Target_Ptr _nullimpl; 00115 }; 00117 00119 inline std::ostream & operator<<( std::ostream & str, const Target & obj ) 00120 { return obj.dumpOn( str ); } 00121 00122 00124 } // namespace zypp 00126 #endif // ZYPP_TARGET_H