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 00068 void reset(); 00069 00075 ResStore::resfilter_const_iterator byKindBegin( const ResObject::Kind & kind_r ) const; 00076 ResStore::resfilter_const_iterator byKindEnd( const ResObject::Kind & kind_r ) const; 00077 00079 static Target_Ptr nullimpl(); 00080 00082 target::rpm::RpmDb & rpmDb(); 00083 00086 bool providesFile (const std::string & name_str, const std::string & path_str) const; 00087 00088 ResObject::constPtr whoOwnsFile (const std::string & path_str) const; 00089 00090 #ifndef STORAGE_DISABLED 00091 00092 bool isStorageEnabled() const; 00093 void enableStorage(const Pathname &root_r); 00094 #endif 00095 00097 bool setInstallationLogfile(const Pathname & path_r); 00098 00100 Pathname root() const; 00101 00103 Date timestamp() const; 00104 public: 00106 explicit 00107 Target( const Pathname & root = "/" ); 00109 explicit 00110 Target( const Impl_Ptr & impl_r ); 00111 00112 private: 00113 friend std::ostream & operator<<( std::ostream & str, const Target & obj ); 00115 std::ostream & dumpOn( std::ostream & str ) const; 00116 00117 private: 00119 friend class zypp_detail::ZYppImpl; 00120 00122 RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl; 00123 00124 static Target_Ptr _nullimpl; 00125 }; 00127 00129 inline std::ostream & operator<<( std::ostream & str, const Target & obj ) 00130 { return obj.dumpOn( str ); } 00131 00132 00134 } // namespace zypp 00136 #endif // ZYPP_TARGET_H
1.5.3