libzypp 17.31.23
XmlString.cc
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
13#include <iostream>
14
16
18namespace zypp
19{
21 namespace xml
22 {
23
25 //
26 // METHOD NAME : XmlString::XmlString
27 // METHOD TYPE : Constructor
28 //
29 XmlString::XmlString( const xmlChar *const xmlstr_r,
30 OnDelete ondelete_r )
31 {
32 if ( xmlstr_r )
33 {
34 if ( ondelete_r == FREE )
35 _xmlstr.reset( xmlstr_r, Deleter() );
36 else
37 _xmlstr.reset( xmlstr_r, NullDeleter() );
38 }
39 }
40
41 /******************************************************************
42 **
43 ** FUNCTION NAME : operator<<
44 ** FUNCTION TYPE : std::ostream &
45 */
46 std::ostream & operator<<( std::ostream & str, const XmlString & obj )
47 {
48 if ( obj )
49 return str << obj.c_str();
50 return str << "NULL";
51 }
52
54 } // namespace xml
57} // namespace zypp
xmlChar * wrapper.
Definition: XmlString.h:41
shared_ptr< const xmlChar > _xmlstr
Wraps the xmlChar *.
Definition: XmlString.h:105
OnDelete
Dtor policy.
Definition: XmlString.h:52
const char * c_str() const
Explicit conversion to const char *.
Definition: XmlString.h:73
XmlString(const xmlChar *const xmlstr_r=NULL, OnDelete ondelete_r=NOFREE)
Ctor from xmlChar.
Definition: XmlString.cc:29
String related utilities and Regular expression matching.
std::ostream & operator<<(std::ostream &str, const ReadState &obj)
Definition: libxmlfwd.cc:29
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2
shared_ptr custom deleter doing nothing.
Definition: PtrTypes.h:83
shared_ptr custom deleter calling xmlFree.
Definition: XmlString.h:44