#include "zypp/base/Logger.h"
#include "zypp/base/DefaultIntegral.h"
#include "zypp/media/MediaAccess.h"
+#include "zypp/parser/xml/XmlEscape.h"
#include "zypp/RepoInfo.h"
#include "zypp/repo/RepoInfoBaseImpl.h"
using namespace std;
+using zypp::xml::escape;
///////////////////////////////////////////////////////////////////
namespace zypp
return str;
}
+ std::ostream & RepoInfo::dumpAsXMLOn( std::ostream & str) const
+ {
+ string tmpstr;
+ str
+ << "<repo"
+ << " alias=\"" << escape(alias()) << "\""
+ << " name=\"" << escape(name()) << "\""
+ << " type=\"" << type().asString() << "\""
+ << " enabled=\"" << enabled() << "\""
+ << " autorefresh=\"" << autorefresh() << "\""
+ << " gpgcheck=\"" << gpgCheck() << "\"";
+ if (!(tmpstr = gpgKeyUrl().asString()).empty())
+ str << " gpgkey=\"" << escape(tmpstr) << "\"";
+ if (!(tmpstr = mirrorListUrl().asString()).empty())
+ str << " mirrorlist=\"" << escape(tmpstr) << "\"";
+ str << ">" << endl;
+
+ for (RepoInfo::urls_const_iterator urlit = baseUrlsBegin();
+ urlit != baseUrlsEnd(); ++urlit)
+ str << "<url>" << escape(urlit->asString()) << "</url>" << endl;
+
+ str << "</repo>" << endl;
+ return str;
+ }
+
std::ostream & operator<<( std::ostream & str, const RepoInfo & obj )
{
return obj.dumpOn(str);
*/
virtual std::ostream & dumpRepoOn( std::ostream & str ) const;
+ /**
+ * Write an XML representation of this RepoInfo object.
+ */
+ virtual std::ostream & dumpAsXMLOn( std::ostream & str) const;
+
class Impl;
private:
/** Pointer to implementation */
#include <ostream>
#include <iostream>
+#include "zypp/parser/xml/XmlEscape.h"
+
#include "zypp/RepoInfo.h"
#include "zypp/parser/RepoindexFileReader.h"
#include "zypp/repo/RepoInfoBaseImpl.h"
#include "zypp/ServiceInfo.h"
using namespace std;
+using zypp::xml::escape;
///////////////////////////////////////////////////////////////////////////////
namespace zypp
return RepoInfoBase::dumpAsIniOn(str) << "url = " << url() << endl;
}
+ std::ostream & ServiceInfo::dumpAsXMLOn( std::ostream & str) const
+ {
+ return str
+ << "<service"
+ << " alias=\"" << escape(alias()) << "\""
+ << " name=\"" << escape(name()) << "\""
+ << " enabled=\"" << enabled() << "\""
+ << " autorefresh=\"" << autorefresh() << "\""
+ << " url=\"" << escape(url().asString()) << "\""
+ << "/>" << endl;
+ }
+
std::ostream & operator<<( std::ostream& str, const ServiceInfo &obj )
{
return obj.dumpAsIniOn(str);
*/
virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
+ /**
+ * Write an XML representation of this ServiceInfo object.
+ */
+ virtual std::ostream & dumpAsXMLOn( std::ostream & str) const;
+
class Impl;
private:
*/
virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
+ /**
+ * Write an XML representation of this object.
+ */
+ virtual std::ostream & dumpAsXMLOn( std::ostream & str) const = 0;
+
class Impl;
private:
/** Pointer to implementation */