public:
/** Get the category of the product */
- virtual std::string category() const
- { return std::string(); }
+ virtual std::string category() const = 0;
+ virtual Label vendor() const = 0;
+ virtual Label displayName() const = 0;
};
///////////////////////////////////////////////////////////////////
#include "zypp/NeedAType.h" // volatile include propagating type drafts
// will be defined =0 later
-#define PURE_VIRTUAL
+#define PURE_VIRTUAL =0
///////////////////////////////////////////////////////////////////
namespace zypp
YUMScriptImpl.h \
YUMMessageImpl.h \
YUMPackageImpl.h \
- YUMPatchImpl.h
+ YUMPatchImpl.h \
+ YUMProductImpl.h
noinst_LTLIBRARIES = lib@PACKAGE@_source_yum.la
YUMScriptImpl.cc \
YUMMessageImpl.cc \
YUMPackageImpl.cc \
- YUMPatchImpl.cc
+ YUMPatchImpl.cc \
+ YUMProductImpl.cc
## ##################################################
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/source/yum/YUMProductImpl.cc
+ *
+*/
+
+#include "zypp/source/yum/YUMProductImpl.h"
+#include "zypp/source/yum/YUMSource.h"
+#include <zypp/CapFactory.h>
+#include "zypp/parser/yum/YUMParserData.h"
+#include <zypp/parser/yum/YUMParser.h>
+#include "zypp/Package.h"
+#include "zypp/Script.h"
+#include "zypp/Message.h"
+#include "zypp/base/Logger.h"
+
+
+using namespace std;
+using namespace zypp::detail;
+using namespace zypp::parser::yum;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace source
+ { /////////////////////////////////////////////////////////////////
+ namespace yum
+ {
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : YUMProductImpl
+ //
+ ///////////////////////////////////////////////////////////////////
+
+ /** Default ctor
+ * \bug CANT BE CONSTUCTED THAT WAY ANYMORE
+ */
+ YUMProductImpl::YUMProductImpl(
+ const zypp::parser::yum::YUMProductData & parsed,
+ YUMSource * src
+ )
+ : _category(parsed.type),
+ _vendor(parsed.vendor)//,
+// _displayname(parsed.displayname),
+// _description(parsed.description)
+ {}
+
+ std::string YUMProductImpl::category() const
+ { return _category; }
+
+ Label YUMProductImpl::vendor() const
+ { return _vendor; }
+
+ Label YUMProductImpl::displayName() const
+ { return _displayname; }
+
+ Label YUMProductImpl::summary() const
+ { return ResObjectImplIf::summary(); }
+
+ Text YUMProductImpl::description() const
+ { return _description; }
+
+ Text YUMProductImpl::insnotify() const
+ { return ResObjectImplIf::insnotify(); }
+
+ Text YUMProductImpl::delnotify() const
+ { return ResObjectImplIf::delnotify(); }
+
+ FSize YUMProductImpl::size() const
+ { return ResObjectImplIf::size(); }
+
+ bool YUMProductImpl::providesSources() const
+ { return ResObjectImplIf::providesSources(); }
+
+ Label YUMProductImpl::instSrcLabel() const
+ { return ResObjectImplIf::instSrcLabel(); }
+
+ Vendor YUMProductImpl::instSrcVendor() const
+ { return ResObjectImplIf::instSrcVendor(); }
+
+ } // namespace yum
+ /////////////////////////////////////////////////////////////////
+ } // namespace source
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/source/yum/YUMProductImpl.h
+ *
+*/
+#ifndef ZYPP_SOURCE_YUM_YUMPRODUCTIMPL_H
+#define ZYPP_SOURCE_YUM_YUMPRODUCTIMPL_H
+
+#include "zypp/detail/ProductImpl.h"
+#include "zypp/parser/yum/YUMParserData.h"
+#include "zypp/source/yum/YUMSource.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace source
+ { /////////////////////////////////////////////////////////////////
+ namespace yum
+ { //////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : YUMProductImpl
+ //
+ /** Class representing a patch
+ */
+ class YUMProductImpl : public detail::ProductImplIf
+ {
+ public:
+ /** Default ctor */
+ YUMProductImpl(
+ const zypp::parser::yum::YUMProductData & parsed,
+ YUMSource * src
+ );
+ std::string category() const;
+ Label vendor() const;
+ Label displayName() const;
+ Label summary() const;
+ Text description() const;
+ Text insnotify() const;
+ Text delnotify() const;
+ FSize size() const;
+ bool providesSources() const;
+ Label instSrcLabel() const;
+ Vendor instSrcVendor() const;
+ protected:
+ std::string _category;
+ Label _vendor;
+ Label _displayname;
+ Text _description;
+
+
+
+ };
+ ///////////////////////////////////////////////////////////////////
+ } // namespace yum
+ /////////////////////////////////////////////////////////////////
+ } // namespace source
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_SOURCE_YUM_YUMPRODUCTIMPL_H
#include "zypp/source/yum/YUMScriptImpl.h"
#include "zypp/source/yum/YUMMessageImpl.h"
#include "zypp/source/yum/YUMPatchImpl.h"
+#include "zypp/source/yum/YUMProductImpl.h"
-#include <zypp/base/Logger.h>
-
-#include <zypp/CapFactory.h>
+#include "zypp/base/Logger.h"
+#include "zypp/CapFactory.h"
using namespace std;
using namespace zypp::detail;
return script;
}
+ Product::Ptr YUMSource::createProduct(
+ const zypp::parser::yum::YUMProductData & parsed
+ )
+ {
+ shared_ptr<YUMProductImpl> impl(new YUMProductImpl(parsed, this));
+ Dependencies _deps = createDependencies(parsed,
+ Resolvable::Kind("Product"));
+ Product::Ptr product = detail::makeResolvableFromImpl(
+ parsed.name,
+ Edition( parsed.ver, parsed.rel ),
+ Arch( "noarch" ),
+ impl
+ );
+ product->setDeps(_deps);
+ return product;
+ }
+
Patch::Ptr YUMSource::createPatch(
const zypp::parser::yum::YUMPatchData & parsed
)
it != parsed.requires.end();
it++)
{
- // FIXME do not create the string this way
- // FIXME other types than only packages
- // FIXME use also the flags
if (it->pre == "1")
_prerequires.insert(createCapability(*it, my_kind));
else
#include "zypp/Message.h"
#include "zypp/Script.h"
#include "zypp/Patch.h"
+#include "zypp/Product.h"
using namespace zypp::parser::yum;
Patch::Ptr createPatch(
const zypp::parser::yum::YUMPatchData & parsed
);
+ Product::Ptr createProduct(
+ const zypp::parser::yum::YUMProductData & parsed
+ );
Dependencies createDependencies(