11#include "abg-internal.h"
13ABG_BEGIN_EXPORT_DECLARATIONS
17ABG_END_EXPORT_DECLARATIONS
27shared_ptr<xmlTextReader>
56 build_sptr(xmlNewTextReaderFilename (path.c_str()));
70 build_sptr(xmlReaderForMemory(buffer.c_str(),
90xml_istream_input_read(
void* context,
94 istream* in =
reinterpret_cast<istream*
>(context);
95 in->read(buffer, len);
106xml_istream_input_close(
void*)
120 build_sptr(xmlReaderForIO(&xml_istream_input_read,
121 &xml_istream_input_close,
139 bool non_nil =
false;
166 if (n->type == XML_DOCUMENT_NODE || n->parent == NULL)
169 if (n->parent->type == XML_DOCUMENT_NODE)
191 std::string& escaped)
193 for (std::string::const_iterator i = str.begin(); i != str.end(); ++i)
249 std::string& escaped)
251 for (std::string::const_iterator i = str.begin(); i != str.end(); ++i)
292 std::string& escaped)
294 std::string::size_type i = 0;
295 while (i < str.size())
306 else if (str[i+1] ==
'g'
313 else if (str[i+1] ==
'a'
321 else if (str[i+1] ==
'a'
330 else if (str[i+1] ==
'q'
380 std::string& escaped)
382 std::string::size_type i = 0;
383 while (i < str.size())
389 && str[i + 4] ==
';')
shared_ptr< xmlChar > build_sptr< xmlChar >(xmlChar *p)
Build and return a shared_ptr for a pointer to xmlChar.
shared_ptr< xmlTextReader > build_sptr< xmlTextReader >(::xmlTextReader *p)
Build and return a shared_ptr for a pointer to xmlTextReader.
void unescape_xml_comment(const std::string &str, std::string &escaped)
Read a string, detect the '#&45;' entity and un-escape it into the '-' character.
reader_sptr new_reader_from_file(const std::string &path)
Instantiate an xmlTextReader that parses the content of an on-disk file, wrap it into a smart pointer...
int get_xml_node_depth(xmlNodePtr n)
Return the depth of an xml element node.
bool xml_char_sptr_to_string(xml_char_sptr ssptr, std::string &s)
Convert a shared pointer to xmlChar into an std::string.
void escape_xml_comment(const std::string &str, std::string &escaped)
Escape the '-' character, to avoid having a '–' in a comment.
reader_sptr new_reader_from_buffer(const std::string &buffer)
Instanciate an xmlTextReader that parses the content of an in-memory buffer, wrap it into a smart poi...
shared_ptr< xmlChar > xml_char_sptr
A convenience typedef for a shared pointer of xmlChar.
void unescape_xml_string(const std::string &str, std::string &escaped)
Read a string, detect the 5 predefined XML entities it may contain and un-escape them,...
reader_sptr new_reader_from_istream(std::istream *in)
Instanciate an xmlTextReader that parses a content coming from an input stream.
shared_ptr< xmlTextReader > reader_sptr
A convenience typedef for a shared pointer of xmlTextReader.
void escape_xml_string(const std::string &str, std::string &escaped)
Escape the 5 characters representing the predefined XML entities.
Toplevel namespace for libabigail.
This functor is used to instantiate a shared_ptr for xmlChar.
This functor is used to instantiate a shared_ptr for the xmlTextReader.