1
/*---------------------------------------------------------------------\
3
| |__ / \ / / . \ . \ |
8
\---------------------------------------------------------------------*/
9
/** \file zypp/parser/xml/XmlEscape.h
12
#ifndef ZYPP_PARSER_XML_XMLESCAPE_H
13
#define ZYPP_PARSER_XML_XMLESCAPE_H
17
#include "zypp/APIConfig.h"
19
///////////////////////////////////////////////////////////////////
22
///////////////////////////////////////////////////////////////////
25
///////////////////////////////////////////////////////////////////
30
EscapedString( const std::string & in_r ) : _in( in_r ) {}
31
std::ostream & dumpOn( std::ostream & str ) const;
32
operator std::string() const
33
{ std::ostringstream str; dumpOn( str ); return str.str(); }
35
const std::string & _in;
38
/** \relates EscapedString Stream output */
39
inline std::ostream & operator<<( std::ostream & str, const EscapedString & obj )
40
{ return obj.dumpOn( str ); }
43
///////////////////////////////////////////////////////////////////
45
/** Escape xml special charaters (<tt>& -> &</tt>; from IoBind library).
46
* The \ref detail::EscapedString can be dumped to an ostream and implicitly
47
* converts into a std::string.
49
inline detail::EscapedString escape( const std::string & in_r )
50
{ return detail::EscapedString( in_r ); }
52
/** Unescape xml special charaters (<tt>& -> &</tt>; from IoBind library) */
53
ZYPP_API std::string unescape( const std::string & in_r );
56
/////////////////////////////////////////////////////////////////
58
///////////////////////////////////////////////////////////////////
59
#endif // ZYPP_PARSER_XML_XMLESCAPE_H