Target.cc

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00012 #include <cassert>
00013 
00014 #include <iostream>
00015 
00016 #include "zypp/Target.h"
00017 #include "zypp/target/TargetImpl.h"
00018 
00019 using namespace std;
00020 
00022 namespace zypp
00023 { 
00024 
00025   IMPL_PTR_TYPE(Target);
00026 
00028   //
00029   //    METHOD NAME : Target::Target
00030   //    METHOD TYPE : Ctor
00031   //
00032   Target::Target( const Pathname & root, bool doRebuild_r )
00033   : _pimpl( new Impl(root,doRebuild_r) )
00034   {
00035   }
00036 
00038   //
00039   //    METHOD NAME : Target::Target
00040   //    METHOD TYPE : Ctor
00041   //
00042   Target::Target( const Impl_Ptr & impl_r )
00043   : _pimpl( impl_r )
00044   {
00045     assert( impl_r );
00046   }
00047 
00048   Target_Ptr Target::_nullimpl;
00049 
00051   Target_Ptr Target::nullimpl()
00052   {
00053     if (! _nullimpl)
00054     {
00055       _nullimpl = new Target(target::TargetImpl::nullimpl());
00056     }
00057     return _nullimpl;
00058   }
00059 
00060   std::ostream & operator<<( std::ostream & str, const Target::DistributionLabel & obj )
00061   {
00062     str << "summary=" << obj.summary << endl;
00063     str << "shortName=" << obj.shortName << endl;
00064     return str;
00065   }
00066 
00068   //
00069   //    Forward to TargetImpl:
00070   //
00072 
00073   void Target::buildCache()
00074   { _pimpl->buildCache(); }
00075 
00076   void Target::cleanCache()
00077   { _pimpl->clearCache(); }
00078 
00079   void Target::load()
00080   { _pimpl->load(); }
00081 
00082   void Target::unload()
00083   { _pimpl->unload(); }
00084 
00085   target::rpm::RpmDb & Target::rpmDb()
00086   { return _pimpl->rpm(); }
00087 
00088   Pathname Target::root() const
00089   { return _pimpl->root(); }
00090 
00091   bool Target::providesFile (const std::string & name_str, const std::string & path_str) const
00092   { return _pimpl->providesFile (name_str, path_str); }
00093 
00094   std::string Target::whoOwnsFile (const std::string & path_str) const
00095   { return _pimpl->whoOwnsFile (path_str); }
00096 
00097   std::ostream & Target::dumpOn( std::ostream & str ) const
00098   { return _pimpl->dumpOn( str ); }
00099 
00100   Date Target::timestamp() const
00101   { return _pimpl->timestamp(); }
00102 
00103   Product::constPtr Target::baseProduct() const
00104   { return _pimpl->baseProduct(); }
00105 
00106   std::string Target::targetDistribution() const
00107   { return _pimpl->targetDistribution(); }
00108   std::string Target::targetDistribution( const Pathname & root_r )
00109   { return target::TargetImpl::targetDistribution( root_r ); }
00110 
00111   std::string Target::targetDistributionRelease() const
00112   { return _pimpl->targetDistributionRelease(); }
00113   std::string Target::targetDistributionRelease( const Pathname & root_r )
00114   { return target::TargetImpl::targetDistributionRelease( root_r ); }
00115 
00116   Target::DistributionLabel Target::distributionLabel() const
00117   { return _pimpl->distributionLabel(); }
00118   Target::DistributionLabel Target::distributionLabel( const Pathname & root_r )
00119   { return target::TargetImpl::distributionLabel( root_r ); }
00120 
00121   std::string Target::distributionVersion() const
00122   { return _pimpl->distributionVersion(); }
00123   std::string Target::distributionVersion( const Pathname & root_r )
00124   { return target::TargetImpl::distributionVersion( root_r ); }
00125 
00126   std::string Target::distributionFlavor() const
00127   { return _pimpl->distributionFlavor(); }
00128   std::string Target::distributionFlavor( const Pathname & root_r )
00129   { return target::TargetImpl::distributionFlavor( root_r ); }
00130 
00131   std::string Target::anonymousUniqueId() const
00132   { return _pimpl->anonymousUniqueId(); }
00133   std::string Target::anonymousUniqueId( const Pathname & root_r )
00134   { return target::TargetImpl::anonymousUniqueId( root_r ); }
00135 
00137 } // namespace zypp

doxygen