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
68 * reload the target in future calls if
70 * note the loading can actually be delayed, but
71 * the next call to resolvables must reflect the
72 * status of the system.
76 /** Null implementation */
77 static Target_Ptr nullimpl();
79 /** Refference to the RPM database */
80 target::rpm::RpmDb & rpmDb();
82 /** If the package is installed and provides the file
83 Needed to evaluate split provides during Resolver::Upgrade() */
84 bool providesFile (const std::string & name_str, const std::string & path_str) const;
86 /** Return name of package owning \a path_str
87 * or empty string if no installed package owns \a path_str.
89 std::string whoOwnsFile (const std::string & path_str) const;
91 /** Set the log file for target */
92 bool setInstallationLogfile(const Pathname & path_r);
94 /** Return the root set for this target */
95 Pathname root() const;
97 /** return the last modification date of the target */
98 Date timestamp() const;
102 Target( const Pathname & root = "/" );
105 Target( const Impl_Ptr & impl_r );
108 friend std::ostream & operator<<( std::ostream & str, const Target & obj );
109 /** Stream output. */
110 std::ostream & dumpOn( std::ostream & str ) const;
113 /** Direct access to Impl. */
114 friend class zypp_detail::ZYppImpl;
116 /** Pointer to implementation */
117 RW_pointer<Impl,rw_pointer::Intrusive<Impl> > _pimpl;
119 static Target_Ptr _nullimpl;
121 ///////////////////////////////////////////////////////////////////
123 /** \relates Target Stream output. */
124 inline std::ostream & operator<<( std::ostream & str, const Target & obj )
125 { return obj.dumpOn( str ); }
128 /////////////////////////////////////////////////////////////////
130 ///////////////////////////////////////////////////////////////////
131 #endif // ZYPP_TARGET_H