- Create the cache directly from the schema (installed) file.
[platform/upstream/libzypp.git] / zypp / Target.cc
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/Target.cc
10  *
11 */
12 #include <cassert>
13
14 #include <iostream>
15
16 #include "zypp/Target.h"
17 #include "zypp/target/TargetImpl.h"
18
19 using namespace std;
20
21 ///////////////////////////////////////////////////////////////////
22 namespace zypp
23 { /////////////////////////////////////////////////////////////////
24
25   IMPL_PTR_TYPE(Target);
26
27   ///////////////////////////////////////////////////////////////////
28   //
29   //    METHOD NAME : Target::Target
30   //    METHOD TYPE : Ctor
31   //
32   Target::Target( const Pathname & root )
33   : _pimpl( new Impl(root) )
34   {
35   }
36
37   ///////////////////////////////////////////////////////////////////
38   //
39   //    METHOD NAME : Target::Target
40   //    METHOD TYPE : Ctor
41   //
42   Target::Target( const Impl_Ptr & impl_r )
43   : _pimpl( impl_r )
44   {
45     assert( impl_r );
46   }
47
48   Target_Ptr Target::_nullimpl;
49
50   /** Null implementation */
51   Target_Ptr Target::nullimpl()
52   {
53     if (! _nullimpl)
54     {
55       _nullimpl = new Target(target::TargetImpl::nullimpl());
56     }
57     return _nullimpl;
58   }
59
60
61   ///////////////////////////////////////////////////////////////////
62   //
63   //    Forward to TargetImpl:
64   //
65   ///////////////////////////////////////////////////////////////////
66
67   const ResStore & Target::resolvables()
68   { return _pimpl->resolvables(); }
69
70   ResStore::resfilter_const_iterator Target::byKindBegin( const ResObject::Kind & kind_r  ) const
71   { return _pimpl->byKindBegin( kind_r ); }
72   
73   ResStore::resfilter_const_iterator Target::byKindEnd( const ResObject::Kind & kind_r  ) const
74   { return _pimpl->byKindEnd( kind_r ); }
75   
76   target::rpm::RpmDb & Target::rpmDb()
77   { return _pimpl->rpm(); }
78
79 #ifndef STORAGE_DISABLED
80       /** enables the storage target */
81   bool Target::isStorageEnabled() const
82   { return _pimpl->isStorageEnabled(); }
83
84   void Target::enableStorage(const Pathname &root_r)
85   { _pimpl->enableStorage(root_r); }
86 #endif
87
88   Pathname Target::root() const
89   { return _pimpl->root(); }
90
91   bool Target::providesFile (const std::string & name_str, const std::string & path_str) const
92   { return _pimpl->providesFile (name_str, path_str); }
93
94   ResObject::constPtr Target::whoOwnsFile (const std::string & path_str) const
95   { return _pimpl->whoOwnsFile (path_str); }
96
97   std::ostream & Target::dumpOn( std::ostream & str ) const
98   { return _pimpl->dumpOn( str ); }
99
100   void Target::getResolvablesToInsDel ( const ResPool pool_r,
101                                     PoolItemList & dellist_r,
102                                     PoolItemList & instlist_r,
103                                     PoolItemList & srclist_r ) const
104   { _pimpl->getResolvablesToInsDel( pool_r, dellist_r, instlist_r, srclist_r ); }
105
106   bool Target::setInstallationLogfile(const Pathname & path_r)
107   { return _pimpl->setInstallationLogfile(path_r); }
108
109   Date Target::timestamp() const
110   { return _pimpl->timestamp(); }
111   
112   void Target::reset()
113   { return _pimpl->reset(); }
114   
115   /////////////////////////////////////////////////////////////////
116 } // namespace zypp
117 ///////////////////////////////////////////////////////////////////