1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Target.h
17 #include "zypp/base/ReferenceCounted.h"
18 #include "zypp/base/NonCopyable.h"
19 #include "zypp/base/PtrTypes.h"
20 #include "zypp/base/Deprecated.h"
22 #include "zypp/Pathname.h"
23 #include "zypp/ResPool.h"
25 ///////////////////////////////////////////////////////////////////
27 { /////////////////////////////////////////////////////////////////
40 DEFINE_PTR_TYPE(Target);
42 ///////////////////////////////////////////////////////////////////
44 // CLASS NAME : Target
48 class Target : public base::ReferenceCounted, public base::NonCopyable
51 typedef target::TargetImpl Impl;
52 typedef intrusive_ptr<Impl> Impl_Ptr;
53 typedef std::list<PoolItem> PoolItemList;
58 * builds or refreshes the target cache
63 * load resolvables into the pool
69 ZYPP_DEPRECATED void reset() {}
71 /** Null implementation */
72 static Target_Ptr nullimpl();
74 /** Refference to the RPM database */
75 target::rpm::RpmDb & rpmDb();
77 /** If the package is installed and provides the file
78 Needed to evaluate split provides during Resolver::Upgrade() */
79 bool providesFile (const std::string & name_str, const std::string & path_str) const;
81 /** Return name of package owning \a path_str
82 * or empty string if no installed package owns \a path_str.
84 std::string whoOwnsFile (const std::string & path_str) const;
86 /** Set the log file for target */
87 bool setInstallationLogfile(const Pathname & path_r);
89 /** Return the root set for this target */
90 Pathname root() const;
92 /** return the last modification date of the target */
93 Date timestamp() const;
98 Target( const Pathname & root = "/" );
101 Target( const Impl_Ptr & impl_r );
104 friend std::ostream & operator<<( std::ostream & str, const Target & obj );
105 /** Stream output. */
106 std::ostream & dumpOn( std::ostream & str ) const;
109 /** Direct access to Impl. */
110 friend class zypp_detail::ZYppImpl;
112 /** Pointer to implementation */
113 RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl;
115 static Target_Ptr _nullimpl;
117 ///////////////////////////////////////////////////////////////////
119 /** \relates Target Stream output. */
120 inline std::ostream & operator<<( std::ostream & str, const Target & obj )
121 { return obj.dumpOn( str ); }
124 /////////////////////////////////////////////////////////////////
126 ///////////////////////////////////////////////////////////////////
127 #endif // ZYPP_TARGET_H