{
DomParser::DomParser()
-: doc_(0)
+: doc_(nullptr)
{
//Start with an empty document:
doc_ = new Document();
}
DomParser::DomParser(const Glib::ustring& filename, bool validate)
-: doc_(0)
+: doc_(nullptr)
{
set_validate(validate);
parse_file(filename);
throw internal_error("Could not create parser context\n" + format_xml_error());
}
- if(context_->directory == 0)
+ if(context_->directory == nullptr)
{
context_->directory = xmlParserGetDirectory(filename.c_str());
}
throw; // re-throw exception
}
- Glib::ustring error_str = format_xml_parser_error(context_);
+ auto error_str = format_xml_parser_error(context_);
if (error_str.empty() && parseError == -1)
error_str = "xmlParseDocument() failed.";
doc_ = new Document(context_->myDoc);
// This is to indicate to release_underlying that we took the
// ownership on the doc.
- context_->myDoc = 0;
+ context_->myDoc = nullptr;
//Free the parse context, but keep the document alive so people can navigate the DOM tree:
//TODO: Why not keep the context alive too?
throw; // re-throw exception
}
- Glib::ustring error_str = format_xml_parser_error(context_);
+ auto error_str = format_xml_parser_error(context_);
if (error_str.empty() && firstParseError != XML_ERR_OK)
error_str = "Error code from xmlParseChunk(): " + Glib::ustring::format(firstParseError);
doc_ = new Document(context_->myDoc);
// This is to indicate to release_underlying that we took the
// ownership on the doc.
- context_->myDoc = 0;
+ context_->myDoc = nullptr;
//Free the parse context, but keep the document alive so people can navigate the DOM tree:
if(doc_)
{
delete doc_;
- doc_ = 0;
+ doc_ = nullptr;
}
Parser::release_underlying();
DomParser::operator bool() const
{
- return doc_ != 0;
+ return doc_ != nullptr;
}
Document* DomParser::get_document()