str
<< "<repo"
<< " alias=\"" << escape(alias()) << "\""
- << " name=\"" << escape(name()) << "\""
- << " type=\"" << type().asString() << "\""
+ << " name=\"" << escape(name()) << "\"";
+ if (type() != repo::RepoType::NONE)
+ str << " type=\"" << type().asString() << "\"";
+ str
<< " enabled=\"" << enabled() << "\""
<< " autorefresh=\"" << autorefresh() << "\""
<< " gpgcheck=\"" << gpgCheck() << "\"";
};
///////////////////////////////////////////////////////////////////
- /** \relates RepoInfo Stream output */
- std::ostream & operator<<( std::ostream & str, const RepoInfo & obj );
-
- inline bool operator<( const RepoInfo& lhs, const RepoInfo & rhs )
- { return lhs.alias() < rhs.alias(); }
-
typedef shared_ptr<RepoInfo> RepoInfo_Ptr;
typedef std::list<RepoInfo> RepoInfoList;
+ /** \relates RepoInfo Stream output */
+ std::ostream & operator<<( std::ostream & str, const RepoInfo & obj );
+
+
/////////////////////////////////////////////////////////////////
} // namespace zypp
///////////////////////////////////////////////////////////////////
/** \relates ServiceInfo Stream output */
std::ostream & operator<<( std::ostream & str, const ServiceInfo & obj );
- /** \relates ServiceInfo */
- inline bool operator==( const ServiceInfo & lhs, const ServiceInfo & rhs )
- { return lhs.alias() == rhs.alias(); }
-
- /** \relates ServiceInfo */
- inline bool operator!=( const ServiceInfo & lhs, const ServiceInfo & rhs )
- { return lhs.alias() != rhs.alias(); }
-
- /** \relates ServiceInfo */
- inline bool operator<( const ServiceInfo & lhs, const ServiceInfo & rhs )
- { return lhs.alias() < rhs.alias(); }
/////////////////////////////////////////////////////////////////
} // namespace zypp
return str;
}
+ std::ostream & RepoInfoBase::dumpAsXMLOn( std::ostream & str) const
+ {
+ return str << "<!-- there's no XML representation of RepoInfoBase -->" << endl;
+ }
+
std::ostream & operator<<( std::ostream & str, const RepoInfoBase & obj )
{
return obj.dumpOn(str);
virtual std::ostream & dumpAsIniOn( std::ostream & str ) const;
/**
- * Write an XML representation of this object.
+ * Write an XML representation of this object. Implement in
+ * derived classes.
*/
- virtual std::ostream & dumpAsXMLOn( std::ostream & str) const = 0;
+ virtual std::ostream & dumpAsXMLOn( std::ostream & str) const;
class Impl;
private:
};
///////////////////////////////////////////////////////////////////
- /** \relates RepoInfoBase Stream output */
- std::ostream & operator<<( std::ostream & str, const RepoInfoBase & obj );
+ /** \relates RepoInfoBase */
+ inline bool operator==( const RepoInfoBase & lhs, const RepoInfoBase & rhs )
+ { return lhs.alias() == rhs.alias(); }
+
+ /** \relates RepoInfoBase */
+ inline bool operator!=( const RepoInfoBase & lhs, const RepoInfoBase & rhs )
+ { return lhs.alias() != rhs.alias(); }
inline bool operator<( const RepoInfoBase & lhs, const RepoInfoBase & rhs )
{ return lhs.alias() < rhs.alias(); }
+ /** \relates RepoInfoBase Stream output */
+ std::ostream & operator<<( std::ostream & str, const RepoInfoBase & obj );
+
typedef shared_ptr<RepoInfoBase> RepoInfoBase_Ptr;