zypp/pool/Makefile \
zypp/solver/Makefile \
zypp/solver/detail/Makefile \
+ zypp/data/Makefile \
zypp/cache/Makefile \
zypp/cache/sqlite3x/Makefile
zypp/source/Makefile \
int main()
{
- cache::KnownSourcesCache("/");
+ cache::KnownSourcesCache cache("/");
+
+ source::SourceInfoList srcs = cache.knownSources();
+ for ( source::SourceInfoList::const_iterator it = srcs.begin(); it != srcs.end(); ++it)
+ {
+ cout << *it << endl;
+ }
}
## ##################################################
SUBDIRS = base thread url media capability detail pool parser \
- source cache target solver zypp_detail ui
+ data source cache target solver zypp_detail ui
AM_CXXFLAGS = -DZYPP_BASE_LOGGER_LOGGROUP=\"zypp\"
parser/lib@PACKAGE@_parser.la \
source/lib@PACKAGE@_source.la \
cache/lib@PACKAGE@_cache.la \
+ data/lib@PACKAGE@_data.la \
media/lib@PACKAGE@_media.la \
url/lib@PACKAGE@_url.la \
target/lib@PACKAGE@_target.la \
{
}
+std::ostream & SourceCacher::dumpOn( std::ostream & str ) const
+{
+ return str;
+}
}
}
--- /dev/null
+## Process this file with automake to produce Makefile.in
+## ##################################################
+
+SUBDIRS =
+
+INCLUDES = -I$(oldincludedir)/libxml2 \
+ -DZYPP_BASE_LOGGER_LOGGROUP=\"data\"
+
+## ##################################################
+
+parserincludedir = $(pkgincludedir)/data
+
+parserinclude_HEADERS = \
+ ResolvableData.h
+
+noinst_LTLIBRARIES = lib@PACKAGE@_data.la
+
+
+## ##################################################
+
+lib@PACKAGE@_data_la_SOURCES = \
+ ResolvableData.cc
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+
+#include "zypp/data/ResolvableData.h"
+
+using namespace std;
+
+namespace zypp
+{
+namespace data
+{
+
+
+Dependency::Dependency(const std::string& kind, const std::string& encoded)
+ : kind(kind), encoded(encoded)
+{
+};
+
+IMPL_PTR_TYPE(ResObject);
+IMPL_PTR_TYPE(Script);
+IMPL_PTR_TYPE(Message);
+IMPL_PTR_TYPE(Selection);
+IMPL_PTR_TYPE(Pattern);
+
+
+std::ostream& operator<<(std::ostream& out, const zypp::shared_ptr<AtomBase> data)
+{
+ out << "Atom data" << endl;
+ switch (data->atomType())
+ {
+ case AtomBase::TypePackage:
+ out << " atom type: " << "package" << endl
+ << *zypp::dynamic_pointer_cast<Patch>(data);
+ break;
+ case AtomBase::TypeMessage:
+ out << " atom type: " << "message" << endl
+ << *zypp::dynamic_pointer_cast<Message>(data);
+ break;
+ case AtomBase::TypeScript:
+ out << " atom type: " << "script" << endl
+ << *zypp::dynamic_pointer_cast<Script>(data);
+ break;
+ default:
+ out << "Unknown atom type" << endl;
+ }
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const Script& data)
+{
+ out << "Script Data: " << endl
+ << " name: " << data.name << endl
+ << " epoch: " << data.epoch << endl
+ << " version: " << data.ver << endl
+ << " release: " << data.rel << endl
+ << " provides: " << data.provides << endl
+ << " conflicts: " << data.conflicts << endl
+ << " obsoletes: " << data.obsoletes << endl
+ << " freshens: " << data.freshens << endl
+ << " requires: " << data.requires << endl
+ << " recommends:" << endl << data.recommends << endl
+ << " suggests:" << endl << data.suggests << endl
+ << " supplements:" << endl << data.supplements << endl
+ << " enhances:" << endl << data.enhances << endl
+ << " do script: " << data.do_script << endl
+ << " undo script: " << data.undo_script << endl
+ << " do script location: " << data.do_location << endl
+ << " undo script location: " << data.undo_location << endl
+ << " do script media: " << data.do_media << endl
+ << " undo script media: " << data.undo_media << endl
+ << " do checksum type: " << data.do_checksum_type << endl
+ << " do checksum: " << data.do_checksum << endl
+ << " undo checksum type: " << data.undo_checksum_type << endl
+ << " undo checksum: " << data.undo_checksum << endl;
+ return out;
+}
+
+std::ostream& operator<<(std::ostream& out, const Message& data)
+{
+ out << "Message Data: " << endl
+ << " name: " << data.name << endl
+ << " epoch: " << data.epoch << endl
+ << " version: " << data.ver << endl
+ << " release: " << data.rel << endl
+ << " provides: " << data.provides << endl
+ << " conflicts: " << data.conflicts << endl
+ << " obsoletes: " << data.obsoletes << endl
+ << " freshens: " << data.freshens << endl
+ << " requires: " << data.requires << endl
+ << " recommends:" << endl << data.recommends << endl
+ << " suggests:" << endl << data.suggests << endl
+ << " supplements:" << endl << data.supplements << endl
+ << " enhances:" << endl << data.enhances << endl
+ << " text: " << data.text << endl;
+ return out;
+}
+
+} // namespace cache
+} // namespace zypp
--- /dev/null
+/*---------------------------------------------------------------------\
+| ____ _ __ __ ___ |
+| |__ / \ / / . \ . \ |
+| / / \ V /| _/ _/ |
+| / /__ | | | | | | |
+| /_____||_| |_| |_| |
+| |
+\---------------------------------------------------------------------*/
+
+
+#ifndef ResolvableData_h
+#define ResolvableData_h
+
+#include "zypp/base/ReferenceCounted.h"
+#include "zypp/base/NonCopyable.h"
+#include "zypp/Pathname.h"
+#include "zypp/Edition.h"
+#include "zypp/Arch.h"
+#include "zypp/TranslatedText.h"
+#include <string>
+#include <list>
+#include <iostream>
+#include <zypp/base/PtrTypes.h>
+
+using namespace zypp::base;
+
+namespace zypp
+{
+namespace data
+{
+ class Dependency
+ {
+ public:
+ Dependency();
+ Dependency(const std::string& kind, const std::string& encoded );
+ std::string kind;
+ std::string encoded;
+ };
+
+ typedef std::list<Dependency> DependencyList;
+
+ class ResObject : public base::ReferenceCounted, private base::NonCopyable
+ {
+ public:
+ std::string name;
+ Edition edition;
+ Arch arch;
+
+ TranslatedText summary;
+ TranslatedText description;
+
+ DependencyList provides;
+ DependencyList conflicts;
+ DependencyList obsoletes;
+ DependencyList freshens;
+ DependencyList requires;
+ DependencyList prerequires;
+ DependencyList recommends;
+ DependencyList suggests;
+ DependencyList supplements;
+ DependencyList enhances;
+ };
+
+ class AtomBase : public ResObject
+ {
+ public:
+ enum AtomType { TypePackage, TypeScript, TypeMessage };
+ virtual AtomType atomType() = 0;
+ };
+
+ class Script : public AtomBase
+ {
+ public:
+ Script() {};
+ virtual AtomType atomType() { return TypeScript; };
+ std::string do_script;
+ std::string undo_script;
+ std::string do_location;
+ std::string undo_location;
+ std::string do_media;
+ std::string undo_media;
+ std::string do_checksum_type;
+ std::string do_checksum;
+ std::string undo_checksum_type;
+ std::string undo_checksum;
+ };
+
+ class Message : public AtomBase
+ {
+ public:
+ Message() {};
+ virtual AtomType atomType() { return TypeMessage; };
+ TranslatedText text;
+ };
+
+ class Selection : public base::ReferenceCounted, private base::NonCopyable
+ {
+ public:
+
+ Selection() {};
+ std::string groupId;
+ TranslatedText name;
+ std::string default_;
+ std::string user_visible;
+ TranslatedText description;
+ //std::list<MetaPkg> grouplist;
+ //std::list<PackageReq> packageList;
+ };
+
+ class Pattern : public ResObject
+ {
+ public:
+
+ Pattern() {};
+
+ std::string default_;
+ std::string user_visible;
+ TranslatedText category;
+ std::string icon;
+ std::string script;
+ };
+
+ class Product : public ResObject
+ {
+ public:
+ Product() {};
+ ~Product() {};
+
+ std::string type;
+ std::string vendor;
+ std::string name;
+ TranslatedText short_name;
+ // those are suse specific tags
+ std::string releasenotesurl;
+ };
+
+ /* Easy output */
+ std::ostream& operator<<(std::ostream &out, const Dependency& data);
+ std::ostream& operator<<(std::ostream &out, const ResObject& data);
+ std::ostream& operator<<(std::ostream &out, const Product& data);
+ std::ostream& operator<<(std::ostream &out, const Pattern& data);
+ std::ostream& operator<<(std::ostream &out, const Selection& data);
+
+} // namespace data
+} // namespace zypp
+
+
+#endif
+