Author: dmacvicar
Date: Tue May 22 18:04:40 2007
New Revision: 5588
URL: http://svn.opensuse.org/viewcvs/zypp?rev=5588&view=rev
Log:
- class to create resolvables from data, for unit tests.
Added:
trunk/libzypp/devel/devel.dmacvicar/YUMReader_tp.cc
trunk/libzypp/zypp2/repository/memory/DPackageImpl.cc
trunk/libzypp/zypp2/repository/memory/DPackageImpl.h
trunk/libzypp/zypp2/repository/memory/DPatternImpl.cc
trunk/libzypp/zypp2/repository/memory/DPatternImpl.h
trunk/libzypp/zypp2/repository/memory/DProductImpl.cc
trunk/libzypp/zypp2/repository/memory/DProductImpl.h
trunk/libzypp/zypp2/repository/memory/DSrcPackageImpl.cc
trunk/libzypp/zypp2/repository/memory/DSrcPackageImpl.h
Removed:
trunk/libzypp/zypp2/repository/memory/DataPackageImpl.cc
trunk/libzypp/zypp2/repository/memory/DataPackageImpl.h
Modified:
trunk/libzypp/devel/devel.dmacvicar/CMakeLists.txt
trunk/libzypp/zypp2/CMakeLists.txt
Modified: trunk/libzypp/devel/devel.dmacvicar/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.dmacvicar/CMakeLists.txt?rev=5588&r1=5587&r2=5588&view=diff
==============================================================================
--- trunk/libzypp/devel/devel.dmacvicar/CMakeLists.txt (original)
+++ trunk/libzypp/devel/devel.dmacvicar/CMakeLists.txt Tue May 22 18:04:40 2007
@@ -24,6 +24,10 @@
TARGET_LINK_LIBRARIES(yum-downloader zypp )
TARGET_LINK_LIBRARIES(yum-downloader zypp2 )
+ADD_EXECUTABLE(yum-reader YUMReader_tp.cc)
+TARGET_LINK_LIBRARIES(yum-reader zypp )
+TARGET_LINK_LIBRARIES(yum-reader zypp2 )
+
ADD_EXECUTABLE(cachedsource CachedSource_tp.cc)
TARGET_LINK_LIBRARIES(cachedsource zypp )
TARGET_LINK_LIBRARIES(cachedsource zypp2 )
Added: trunk/libzypp/devel/devel.dmacvicar/YUMReader_tp.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.dmacvicar/YUMReader_tp.cc?rev=5588&view=auto
==============================================================================
--- trunk/libzypp/devel/devel.dmacvicar/YUMReader_tp.cc (added)
+++ trunk/libzypp/devel/devel.dmacvicar/YUMReader_tp.cc Tue May 22 18:04:40 2007
@@ -0,0 +1,129 @@
+#include "zypp/ZYpp.h"
+#include "zypp/ZYppFactory.h"
+#include "zypp/base/Logger.h"
+#include "zypp/base/LogControl.h"
+#include "zypp/CapFactory.h"
+#include "zypp/data/ResolvableDataConsumer.h"
+#include "zypp/base/Measure.h"
+#include "zypp/detail/ResObjectFactory.h"
+#include "zypp2/parser/yum/YUMParser.h"
+#include "zypp2/repository/memory/DPackageImpl.h"
+
+
+#undef ZYPP_BASE_LOGGER_LOGGROUP
+#define ZYPP_BASE_LOGGER_LOGGROUP "yumparsertest"
+
+using namespace std;
+using namespace zypp;
+using namespace zypp::parser::yum;
+using zypp::debug::Measure;
+using namespace zypp::repository::memory;
+
+bool progress_function(ProgressData::value_type p)
+{
+ cout << "Parsing YUM source [" << p << "%]" << endl;
+// cout << "\rParsing YUM source [" << p << "%]" << flush;
+ return true;
+}
+
+class ResolvableConsumer : public data::ResolvableDataConsumer
+{
+ public:
+
+ typedef detail::ResImplTraits<DPackageImpl>::Ptr PkgImplPtr;
+ typedef detail::ResImplTraits<DPackageImpl>::Ptr SrcPkgImplPtr;
+
+ ResolvableConsumer()
+ {
+
+ }
+
+ void collectDeps( Dependencies &deps, const data::Dependencies &data_deps)
+ {
+ CapFactory factory;
+ for ( data::Dependencies::const_iterator i = data_deps.begin(); i != data_deps.end(); ++i )
+ {
+ data::DependencyList list(i->second);
+ zypp::Dep deptype(i->first);
+ for ( data::DependencyList::const_iterator it = list.begin(); it != list.end(); ++it )
+ {
+ deps[deptype].insert(factory.fromImpl(*it));
+ }
+ }
+ }
+
+ virtual ~ResolvableConsumer()
+ {
+
+ }
+
+ virtual void consumePackage( const data::RecordId &catalog_id, data::Package_Ptr ptr )
+ {
+ PkgImplPtr impl = PkgImplPtr( new DPackageImpl(ptr) );
+ Dependencies deps;
+ collectDeps( deps, ptr->deps );
+
+ Package::Ptr pkg = detail::makeResolvableFromImpl( NVRAD( ptr->name, ptr->edition, ptr->arch, deps), impl );
+ _store.insert(pkg);
+ }
+ virtual void consumeProduct( const data::RecordId &catalog_id, data::Product_Ptr )
+ {
+ }
+ virtual void consumePatch( const data::RecordId &catalog_id, data::Patch_Ptr )
+ {
+ }
+ virtual void consumeMessage( const data::RecordId &catalog_id, data::Message_Ptr )
+ {
+
+ }
+
+ virtual void consumeScript( const data::RecordId &catalog_id, data::Script_Ptr )
+ {
+
+ }
+
+ virtual void consumeChangelog( const data::RecordId & catalog_id, const data::Resolvable_Ptr &, const Changelog & )
+ {
+
+ }
+
+ virtual void consumeFilelist( const data::RecordId & catalog_id, const data::Resolvable_Ptr &, const data::Filenames & )
+ {}
+
+ //virtual void consumeSourcePackage( const data::SrcPackage_Ptr ) = 0;
+ ResStore _store;
+};
+
+
+int main(int argc, char **argv)
+{
+ base::LogControl::instance().logfile("yumparsertest.log");
+
+ if (argc < 2)
+ {
+ cout << "usage: yumparsertest path/to/yumsourcedir" << endl << endl;
+ return 1;
+ }
+
+ try
+ {
+ ZYpp::Ptr z = getZYpp();
+
+ MIL << "creating PrimaryFileParser" << endl;
+ Measure parse_primary_timer("primary.xml.gz parsing");
+ ResolvableConsumer store;
+ parser::yum::YUMParser parser( 0, store, &progress_function);
+ parser.start(argv[1]);
+ parse_primary_timer.stop();
+
+ cout << endl;
+ }
+ catch ( const Exception &e )
+ {
+ cout << "Oops! " << e.msg() << std::endl;
+ }
+
+ return 0;
+}
+
+// vim: set ts=2 sts=2 sw=2 et ai:
Modified: trunk/libzypp/zypp2/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/CMakeLists.txt?rev=5588&r1=5587&r2=5588&view=diff
==============================================================================
--- trunk/libzypp/zypp2/CMakeLists.txt (original)
+++ trunk/libzypp/zypp2/CMakeLists.txt Tue May 22 18:04:40 2007
@@ -99,11 +99,17 @@
)
SET( zypp2_repository_data_SRCS
- repository/memory/DataPackageImpl.cc
+ repository/memory/DPackageImpl.cc
+ repository/memory/DPatternImpl.cc
+ repository/memory/DProductImpl.cc
+ repository/memory/DSrcPackageImpl.cc
)
SET( zypp2_repository_data_HEADERS
- repository/memory/DataPackageImpl.h
+ repository/memory/DPackageImpl.h
+ repository/memory/DPatternImpl.h
+ repository/memory/DProductImpl.h
+ repository/memory/DSrcPackageImpl.h
)
SET( zypp2_parser_yum_SRCS
Added: trunk/libzypp/zypp2/repository/memory/DPackageImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/repository/memory/DPackageImpl.cc?rev=5588&view=auto
==============================================================================
--- trunk/libzypp/zypp2/repository/memory/DPackageImpl.cc (added)
+++ trunk/libzypp/zypp2/repository/memory/DPackageImpl.cc Tue May 22 18:04:40 2007
@@ -0,0 +1,242 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp2/repository/memory/DPackageImpl.cc
+ *
+*/
+
+#include "zypp2/repository/memory/DPackageImpl.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////
+namespace repository
+{ /////////////////////////////////////////////////////////////////
+namespace memory
+{ /////////////////////////////////////////////////////////////////
+
+///////////////////////////////////////////////////////////////////
+//
+// METHOD NAME : PackageImpl::PackageImpl
+// METHOD TYPE : Ctor
+//
+DPackageImpl::DPackageImpl(data::Package_Ptr ptr)
+ :
+ _summary(ptr->summary),
+ _description(ptr->description),
+ _insnotify(ptr->insnotify),
+ _delnotify(ptr->delnotify),
+ _license_to_confirm(ptr->licenseToConfirm),
+ _group(ptr->group),
+ _keywords(),
+ _authors(ptr->authors),
+ _size(ptr->installedSize),
+ _archivesize(ptr->repositoryLocation.fileSize),
+ _vendor(ptr->vendor),
+ _license(ptr->license),
+ _buildtime(ptr->buildTime),
+ _media_number(ptr->repositoryLocation.mediaNr),
+ _location(ptr->repositoryLocation.filePath),
+ _diskusage(),
+ _checksum(ptr->repositoryLocation.fileChecksum)
+{
+}
+
+///////////////////////////////////////////////////////////////////
+//
+// METHOD NAME : PackageImpl::~PackageImpl
+// METHOD TYPE : Dtor
+//
+DPackageImpl::~DPackageImpl()
+{}
+
+TranslatedText DPackageImpl::summary() const
+{
+ return _summary;
+}
+
+TranslatedText DPackageImpl::description() const
+{
+ return _description;
+}
+
+TranslatedText DPackageImpl::insnotify() const
+{
+ return _insnotify;
+}
+
+TranslatedText DPackageImpl::delnotify() const
+{
+ return _delnotify;
+}
+
+TranslatedText DPackageImpl::licenseToConfirm() const
+{
+ return _license_to_confirm;
+}
+
+Source_Ref DPackageImpl::source() const
+{
+ return Source_Ref::noSource;
+}
+
+unsigned DPackageImpl::sourceMediaNr() const
+{
+ return _media_number;
+}
+
+CheckSum DPackageImpl::checksum() const
+{
+ return _checksum;
+}
+
+Date DPackageImpl::buildtime() const
+{
+ return _buildtime;
+}
+
+string DPackageImpl::buildhost() const
+{
+ return string();
+}
+
+Date DPackageImpl::installtime() const
+{
+ return Date();
+} // it was never installed
+
+string DPackageImpl::distribution() const
+{
+ return string();
+}
+
+Vendor DPackageImpl::vendor() const
+{
+ return string();
+}
+
+Label DPackageImpl::license() const
+{
+ return _license;
+}
+
+string DPackageImpl::packager() const
+{
+ return string();
+}
+
+PackageGroup DPackageImpl::group() const
+{
+ return _group;
+}
+
+DPackageImpl::Keywords DPackageImpl::keywords() const
+{
+ return _keywords;
+}
+
+Changelog DPackageImpl::changelog() const
+{
+ return Changelog();
+}
+
+Pathname DPackageImpl::location() const
+{
+ return _location;
+}
+
+string DPackageImpl::url() const
+{
+ return string();
+}
+
+string DPackageImpl::os() const
+{
+ return string();
+}
+
+Text DPackageImpl::prein() const
+{
+ return Text();
+}
+
+Text DPackageImpl::postin() const
+{
+ return Text();
+}
+
+Text DPackageImpl::preun() const
+{
+ return Text();
+}
+
+Text DPackageImpl::postun() const
+{
+ return Text();
+}
+
+ByteCount DPackageImpl::size() const
+{
+ return _size;
+}
+
+ByteCount DPackageImpl::sourcesize() const
+// FIXME
+{
+ return 0;
+}
+
+ByteCount DPackageImpl::archivesize() const
+{
+ return _archivesize;
+}
+
+DiskUsage DPackageImpl::diskusage() const
+{
+ return _diskusage;
+}
+
+list<string> DPackageImpl::authors() const
+{
+ return list<string>();
+}
+
+list<string> DPackageImpl::filenames() const
+{
+ return list<string>();
+}
+
+listdetail::PackageImplIf::DeltaRpm DPackageImpl::deltaRpms() const
+{
+ return detail::PackageImplIf::deltaRpms();
+}
+
+listdetail::PackageImplIf::PatchRpm DPackageImpl::patchRpms() const
+{
+ return detail::PackageImplIf::patchRpms();
+}
+
+bool DPackageImpl::installOnly() const
+{
+ return false;
+}
+
+/////////////////////////////////////////////////////////////////
+} // namespace memory
+///////////////////////////////////////////////////////////////////
+/////////////////////////////////////////////////////////////////
+} // namespace
+///////////////////////////////////////////////////////////////////
+
+/////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+
Added: trunk/libzypp/zypp2/repository/memory/DPackageImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/repository/memory/DPackageImpl.h?rev=5588&view=auto
==============================================================================
--- trunk/libzypp/zypp2/repository/memory/DPackageImpl.h (added)
+++ trunk/libzypp/zypp2/repository/memory/DPackageImpl.h Tue May 22 18:04:40 2007
@@ -0,0 +1,111 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp/source/memory/DPackageImpl.h
+ *
+*/
+#ifndef ZYPP_SOURCE_MEMORYPACKAGEIMPL_H
+#define ZYPP_SOURCE_MEMORYPACKAGEIMPL_H
+
+#include "zypp/detail/PackageImplIf.h"
+#include "zypp/Source.h"
+#include "zypp/data/ResolvableData.h"
+#include "zypp/DiskUsage.h"
+#include "zypp/CheckSum.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace repository
+ { /////////////////////////////////////////////////////////////////
+ namespace memory
+ { /////////////////////////////////////////////////////////////////
+
+ DEFINE_PTR_TYPE(DImpl);
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : PackageImpl
+ //
+ /**
+ */
+ struct DPackageImpl : public zypp::detail::PackageImplIf
+ {
+ DPackageImpl( data::Package_Ptr ptr );
+ virtual ~DPackageImpl();
+
+ /** \name ResObject attributes. */
+ //@{
+ virtual TranslatedText summary() const;
+ virtual TranslatedText description() const;
+ virtual TranslatedText insnotify() const;
+ virtual TranslatedText delnotify() const;
+ virtual TranslatedText licenseToConfirm() const;
+ virtual Source_Ref source() const;
+ virtual unsigned sourceMediaNr() const;
+ //@}
+
+ virtual CheckSum checksum() const;
+ virtual Date buildtime() const;
+ virtual std::string buildhost() const;
+ virtual Date installtime() const;
+ virtual std::string distribution() const;
+ virtual Vendor vendor() const;
+ virtual Label license() const;
+ virtual std::string packager() const;
+ virtual PackageGroup group() const;
+ virtual Keywords keywords() const;
+ virtual Changelog changelog() const;
+ virtual Pathname location() const;
+ virtual std::string url() const;
+ virtual std::string os() const;
+ virtual Text prein() const;
+ virtual Text postin() const;
+ virtual Text preun() const;
+ virtual Text postun() const;
+ virtual ByteCount size() const;
+ virtual ByteCount sourcesize() const;
+ virtual ByteCount archivesize() const;
+ virtual DiskUsage diskusage() const;
+ virtual std::liststd::string authors() const;
+ virtual std::liststd::string filenames() const;
+ virtual std::list<DeltaRpm> deltaRpms() const;
+ virtual std::list<PatchRpm> patchRpms() const;
+ virtual bool installOnly() const;
+
+ TranslatedText _summary;
+ TranslatedText _description;
+ TranslatedText _insnotify;
+ TranslatedText _delnotify;
+ TranslatedText _license_to_confirm;
+
+ PackageGroup _group;
+ Keywords _keywords;
+ std::liststd::string _authors;
+ ByteCount _size;
+ ByteCount _archivesize;
+ Vendor _vendor;
+ Label _license;
+ Date _buildtime;
+ unsigned _media_number;
+ Pathname _location;
+ DiskUsage _diskusage;
+ CheckSum _checksum;
+private:
+ };
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+ } // namespace memory
+ /////////////////////////////////////////////////////////////////
+ } // namespace repository
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_DETAIL_PACKAGEIMPL_H
Added: trunk/libzypp/zypp2/repository/memory/DPatternImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/repository/memory/DPatternImpl.cc?rev=5588&view=auto
==============================================================================
--- trunk/libzypp/zypp2/repository/memory/DPatternImpl.cc (added)
+++ trunk/libzypp/zypp2/repository/memory/DPatternImpl.cc Tue May 22 18:04:40 2007
@@ -0,0 +1,81 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp2/repository/memory/DPatternImpl.cc
+ *
+*/
+#include "zypp2/repository/memory/DPatternImpl.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////
+namespace repository
+{ /////////////////////////////////////////////////////////////////
+namespace memory
+{
+///////////////////////////////////////////////////////////////////
+//
+// METHOD NAME : PatternImpl::PatternImpl
+// METHOD TYPE : Ctor
+//
+DPatternImpl::DPatternImpl(data::Pattern_Ptr ptr)
+{}
+
+///////////////////////////////////////////////////////////////////
+//
+// METHOD NAME : PatternImpl::~PatternImpl
+// METHOD TYPE : Dtor
+//
+DPatternImpl::~DPatternImpl()
+{}
+
+Source_Ref DPatternImpl::source() const
+{
+ return Source_Ref::noSource;
+}
+
+TranslatedText DPatternImpl::summary() const
+{
+ return _summary;
+}
+
+TranslatedText DPatternImpl::description() const
+{
+ return _description;
+}
+
+TranslatedText DPatternImpl::category() const
+{
+ return _category;
+}
+
+bool DPatternImpl::userVisible() const
+{
+ return _visible;
+}
+
+Label DPatternImpl::order() const
+{
+ return _order;
+}
+
+Pathname DPatternImpl::icon() const
+{
+ return _icon;
+}
+
+/////////////////////////////////////////////////////////////////
+} // namespace detail
+///////////////////////////////////////////////////////////////////
+}
+/////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
Added: trunk/libzypp/zypp2/repository/memory/DPatternImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/repository/memory/DPatternImpl.h?rev=5588&view=auto
==============================================================================
--- trunk/libzypp/zypp2/repository/memory/DPatternImpl.h (added)
+++ trunk/libzypp/zypp2/repository/memory/DPatternImpl.h Tue May 22 18:04:40 2007
@@ -0,0 +1,64 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp2/repository/memory/DPatternImpl.h
+ *
+*/
+#ifndef ZYPP_DETAIL_MEMORY_PATTERNIMPL_H
+#define ZYPP_DETAIL_MEMORY_PATTERNIMPL_H
+
+#include "zypp/detail/PatternImplIf.h"
+#include "zypp/data/ResolvableData.h"
+#include "zypp/Source.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace repository
+ { /////////////////////////////////////////////////////////////////
+ namespace memory
+ {
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : PatternImpl
+ //
+ /**
+ */
+ struct DPatternImpl : public zypp::detail::PatternImplIf
+ {
+public:
+ DPatternImpl(data::Pattern_Ptr ptr);
+ virtual ~DPatternImpl();
+
+ virtual TranslatedText summary() const;
+ virtual TranslatedText description() const;
+ virtual TranslatedText category() const;
+ virtual bool userVisible() const;
+ virtual Label order() const;
+ virtual Pathname icon() const;
+ virtual Source_Ref source() const;
+
+ TranslatedText _summary;
+ TranslatedText _description;
+ TranslatedText _category;
+ bool _visible;
+ std::string _order;
+ Pathname _icon;
+ };
+ ///////////////////////////////////////////////////////////////////
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace memory
+ ///////////////////////////////////////////////////////////////////
+ } // namespace repository
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
+#endif // ZYPP_DETAIL_PATTERNIMPL_H
Added: trunk/libzypp/zypp2/repository/memory/DProductImpl.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/repository/memory/DProductImpl.cc?rev=5588&view=auto
==============================================================================
--- trunk/libzypp/zypp2/repository/memory/DProductImpl.cc (added)
+++ trunk/libzypp/zypp2/repository/memory/DProductImpl.cc Tue May 22 18:04:40 2007
@@ -0,0 +1,111 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp2/repository/memory/DProductImpl.cc
+ *
+*/
+#include "zypp2/repository/memory/DProductImpl.h"
+
+using namespace std;
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace repository
+ { /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace memory
+ { /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : DProductImpl::DProductImpl
+ // METHOD TYPE : Ctor
+ //
+ DProductImpl::DProductImpl(data::Product_Ptr ptr)
+ {}
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // METHOD NAME : DProductImpl::~DProductImpl
+ // METHOD TYPE : Dtor
+ //
+ DProductImpl::~DProductImpl()
+ {}
+
+
+ std::string DProductImpl::category() const
+ {
+ return _category;
+ }
+
+ Label DProductImpl::vendor() const
+ {
+ return _vendor;
+ }
+
+ TranslatedText DProductImpl::summary() const
+ {
+ return _summary;
+ }
+
+ Source_Ref DProductImpl::source() const
+ {
+ return Source_Ref::noSource;
+ }
+
+ Url DProductImpl::releaseNotesUrl() const
+ {
+ return _release_notes_url;
+ }
+
+ std::list<Url> DProductImpl::updateUrls() const
+ {
+ return _update_urls;
+ }
+
+ std::list<Url> DProductImpl::extraUrls() const
+ {
+ return _extra_urls;
+ }
+
+ std::list<Url> DProductImpl::optionalUrls() const
+ {
+ return _optional_urls;
+ }
+
+ std::liststd::string DProductImpl::flags() const
+ {
+ return _flags;
+ }
+
+ TranslatedText DProductImpl::shortName() const
+ {
+ return TranslatedText(_shortlabel);
+ }
+
+ std::string DProductImpl::distributionName() const
+ {
+ return _dist_name;
+ }
+
+ Edition DProductImpl::distributionEdition() const
+ {
+ return _dist_version;
+ }
+
+ /////////////////////////////////////////////////////////////////
+ } // namespace memory
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+ } // namespace repository
+ ///////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////
+} // namespace zypp
+///////////////////////////////////////////////////////////////////
Added: trunk/libzypp/zypp2/repository/memory/DProductImpl.h
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp2/repository/memory/DProductImpl.h?rev=5588&view=auto
==============================================================================
--- trunk/libzypp/zypp2/repository/memory/DProductImpl.h (added)
+++ trunk/libzypp/zypp2/repository/memory/DProductImpl.h Tue May 22 18:04:40 2007
@@ -0,0 +1,102 @@
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+/** \file zypp2/repository/memory/DProductImpl.h
+ *
+*/
+#ifndef ZYPP_DETAIL_MEMORY_PRODUCTIMPL_H
+#define ZYPP_DETAIL_MEMORY_PRODUCTIMPL_H
+
+#include <map>
+
+#include "zypp/CheckSum.h"
+#include "zypp/CapSet.h"
+#include "zypp/detail/ProductImplIf.h"
+#include "zypp/Source.h"
+#include "zypp/data/ResolvableData.h"
+#include "zypp/TranslatedText.h"
+
+///////////////////////////////////////////////////////////////////
+namespace zypp
+{ /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace repository
+ { /////////////////////////////////////////////////////////////////
+ ///////////////////////////////////////////////////////////////////
+ namespace memory
+ { /////////////////////////////////////////////////////////////////
+
+ ///////////////////////////////////////////////////////////////////
+ //
+ // CLASS NAME : ProductImpl
+ //
+ /**
+ */
+ struct DProductImpl : public zypp::detail::ProductImplIf
+ {
+ public:
+ DProductImpl(data::Product_Ptr ptr);
+ virtual ~DProductImpl();
+
+ virtual std::string category() const;
+ virtual Label vendor() const;
+ virtual TranslatedText summary() const;
+ virtual Source_Ref source() const;
+ virtual Url releaseNotesUrl() const;
+
+ virtual std::list<Url> updateUrls() const;
+ virtual std::list<Url> extraUrls() const;
+ virtual std::list<Url> optionalUrls() const;
+
+ virtual std::liststd::string flags() const;
+ virtual TranslatedText shortName() const;
+ virtual std::string distributionName() const;
+ virtual Edition distributionEdition() const;
+
+ std::string _category;
+
+ std::string _name;
+ std::string _version;
+ std::string _dist_name;
+ Edition _dist_version;
+
+ std::string _base_product;
+ std::string _base_version;
+ std::string _you_type;
+ std::string _shortlabel;
+ std::string _vendor;
+ Url _release_notes_url;
+
+ std::list<Url> _update_urls;
+ std::list<Url> _extra_urls;
+ std::list<Url> _optional_urls;
+
+ std::map< std::string, std::liststd::string > _arch; // map of 'arch : "arch1 arch2 arch3"', arch1 being 'best', arch3 being 'noarch' (ususally)
+ std::string _default_base;
+ Dependencies _deps;
+ std::liststd::string _languages;
+ TranslatedText _summary;
+ std::string _description_dir;
+ std::string _data_dir;
+ std::liststd::string _flags;
+ std::string _language;
+ std::string _timezone;
+
+ std::map