YUMMessageImpl.h \
YUMPackageImpl.h \
YUMPatchImpl.h \
+ YUMGroupImpl.h \
YUMProductImpl.h
YUMMessageImpl.cc \
YUMPackageImpl.cc \
YUMPatchImpl.cc \
+ YUMGroupImpl.cc \
YUMProductImpl.cc
## ##################################################
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/source/yum/YUMGroupImpl.cc
+ *
+*/
+
+#include "zypp/source/yum/YUMGroupImpl.h"
+
+using namespace std;
+using namespace zypp::detail;
+using namespace zypp::parser::yum;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace source
+ { /////////////////////////////////////////////////////////////////
+ namespace yum
+ {
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : YUMGroupImpl
+ //
+ ///////////////////////////////////////////////////////////////////
+
+ /** Default ctor
+ */
+ YUMGroupImpl::YUMGroupImpl(
+ const zypp::parser::yum::YUMGroupData & parsed
+ )
+ : _user_visible(parsed.userVisible == "true")
+ {
+ for (std::list<PackageReq>::const_iterator it
+ = parsed.packageList.begin();
+ it != parsed.packageList.end();
+ it++)
+ {
+ _pkgs_req.push_back(PkgReq(it->type, it->name, it->ver,
+ it->rel, it->epoch));
+ }
+ for (std::list<MetaPkg>::const_iterator it
+ = parsed.grouplist.begin();
+ it != parsed.grouplist.end();
+ it++)
+ {
+ _groups_req.push_back(GroupReq(it->type, it->name));
+ }
+// to name std::string groupId;
+// as _summary std::list<multilang> name;
+// _description
+ }
+ /** Is to be visible for user? */
+ bool YUMGroupImpl::userVisible() const {
+ return _user_visible;
+ }
+
+ std::list<YUMGroupImpl::GroupReq> YUMGroupImpl::groupsReq() const
+ { return _groups_req; }
+
+ std::list<YUMGroupImpl::PkgReq> YUMGroupImpl::pkgsReq() const
+ { return _pkgs_req; }
+
+ Label YUMGroupImpl::summary() const
+ { return ResObjectImplIf::summary(); }
+
+ Text YUMGroupImpl::description() const
+ { return ResObjectImplIf::description(); }
+
+ Text YUMGroupImpl::insnotify() const
+ { return ResObjectImplIf::insnotify(); }
+
+ Text YUMGroupImpl::delnotify() const
+ { return ResObjectImplIf::delnotify(); }
+
+ bool YUMGroupImpl::providesSources() const
+ { return ResObjectImplIf::providesSources(); }
+
+ Label YUMGroupImpl::instSrcLabel() const
+ { return ResObjectImplIf::instSrcLabel(); }
+
+ Vendor YUMGroupImpl::instSrcVendor() const
+ { return ResObjectImplIf::instSrcVendor(); }
+
+ FSize YUMGroupImpl::size() const
+ { return ResObjectImplIf::size(); }
+
+
+ } // namespace yum
+ /////////////////////////////////////////////////////////////////
+ } // namespace source
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/source/yum/YUMGroupImpl.h
+ *
+*/
+#ifndef ZYPP_SOURCE_YUM_YUMGROUPIMPL_H
+#define ZYPP_SOURCE_YUM_YUMGROUPIMPL_H
+
+#include "zypp/detail/SelectionImplIf.h"
+#include "zypp/parser/yum/YUMParserData.h"
+#include "zypp/Edition.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace source
+ { /////////////////////////////////////////////////////////////////
+ namespace yum
+ { //////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : YUMGroupImpl
+ //
+ /** Class representing a message
+ */
+ class YUMGroupImpl : public detail::SelectionImplIf
+ {
+ public:
+ class GroupReq
+ {
+ public:
+ GroupReq(const std::string & type, const std::string & name)
+ : _type(type)
+ , _name(name)
+ {}
+ std::string type() const { return _type; }
+ std::string name() const { return _name; }
+ private:
+ std::string _type;
+ std::string _name;
+ };
+ class PkgReq
+ {
+ public:
+ PkgReq(const std::string & type, const std::string & name,
+ const std::string & ver, const std::string & rel,
+ const std::string & epoch)
+ : _type(type)
+ , _name(name)
+ , _edition(ver, rel, epoch)
+ {}
+ std::string type() const { return _type; }
+ std::string name() const { return _name; }
+ Edition edition() const { return _edition; }
+ private:
+ std::string _type;
+ std::string _name;
+ Edition _edition;
+ };
+ /** Default ctor */
+ YUMGroupImpl( const zypp::parser::yum::YUMGroupData & parsed );
+ /** Is to be visible for user? */
+ virtual bool userVisible() const;
+ /** Other requested groups */
+ virtual std::list<GroupReq> groupsReq() const;
+ /** Requested packages */
+ virtual std::list<PkgReq> pkgsReq() const;
+ /** */
+ virtual Label summary() const;
+ /** */
+ virtual Text description() const;
+ /** */
+ virtual Text insnotify() const;
+ /** */
+ virtual Text delnotify() const;
+ /** */
+ virtual bool providesSources() const;
+ /** */
+ virtual Label instSrcLabel() const;
+ /** */
+ virtual Vendor instSrcVendor() const;
+ /** */
+ virtual FSize size() const;
+
+
+ protected:
+// _summary
+// _description;
+ bool _user_visible;
+ std::list<GroupReq> _groups_req;
+ std::list<PkgReq> _pkgs_req;
+ };
+ ///////////////////////////////////////////////////////////////////
+ } // namespace yum
+ /////////////////////////////////////////////////////////////////
+ } // namespace source
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_SOURCE_YUM_YUMGROUPIMPL_H
#include "zypp/source/yum/YUMMessageImpl.h"
#include "zypp/source/yum/YUMPatchImpl.h"
#include "zypp/source/yum/YUMProductImpl.h"
+#include "zypp/source/yum/YUMGroupImpl.h"
#include "zypp/base/Logger.h"
#include "zypp/CapFactory.h"
}
}
+ Selection::Ptr createGroup(
+ const zypp::parser::yum::YUMGroupData & parsed
+ )
+ {
+ try
+ {
+ shared_ptr<YUMGroupImpl> impl(new YUMGroupImpl(parsed));
+ Selection::Ptr group = detail::makeResolvableFromImpl(
+ parsed.groupId,
+ Edition::noedition,
+ Arch_noarch,
+ impl
+ );
+ return group;
+ }
+ catch (const Exception & excpt_r)
+ {
+ ERR << excpt_r << endl;
+ throw "Cannot create package group object";
+ }
+ }
+
Message::Ptr YUMSource::createMessage(
const zypp::parser::yum::YUMPatchMessage & parsed
)
#include "zypp/Script.h"
#include "zypp/Patch.h"
#include "zypp/Product.h"
+#include "zypp/Selection.h"
using namespace zypp::parser::yum;
Package::Ptr createPackage(
const zypp::parser::yum::YUMPatchPackage & parsed
);
+ Selection::Ptr createGroup(
+ const zypp::parser::yum::YUMGroupData & parsed
+ );
Message::Ptr createMessage(
const zypp::parser::yum::YUMPatchMessage & parsed
);