[libxml++] C++11: Use nullptr instead of 0.



commit 0da5c841928457903e928eb5504bc4a1fae2af73
Author: Murray Cumming <murrayc murrayc com>
Date:   Sun Jul 19 21:28:46 2015 +0200

    C++11: Use nullptr instead of 0.

 examples/dom_update_namespace/main.cc      |    2 +-
 examples/import_node/main.cc               |    2 +-
 examples/sax_parser_build_dom/svgparser.cc |    8 ++++----
 libxml++/attribute.cc                      |    2 +-
 libxml++/document.cc                       |    6 +++---
 libxml++/exceptions/exception.cc           |    2 +-
 libxml++/exceptions/exception.h            |    2 +-
 libxml++/io/outputbuffer.cc                |    8 ++++----
 libxml++/nodes/element.cc                  |    6 +++---
 libxml++/nodes/node.cc                     |   12 ++++++------
 libxml++/nodes/node.h                      |   12 ++++++------
 libxml++/parsers/domparser.cc              |   14 +++++++-------
 libxml++/parsers/parser.cc                 |   10 +++++-----
 libxml++/parsers/saxparser.cc              |    2 +-
 libxml++/parsers/textreader.cc             |    4 ++--
 libxml++/relaxngschema.cc                  |    4 ++--
 libxml++/schema.cc                         |    4 ++--
 libxml++/validators/dtdvalidator.cc        |   10 +++++-----
 libxml++/validators/relaxngvalidator.cc    |    6 +++---
 libxml++/validators/schemavalidator.cc     |   20 ++++++++++----------
 libxml++/validators/validator.cc           |    8 ++++----
 libxml++/validators/xsdvalidator.cc        |    6 +++---
 libxml++/xsdschema.cc                      |    6 +++---
 23 files changed, 78 insertions(+), 78 deletions(-)
---
diff --git a/examples/dom_update_namespace/main.cc b/examples/dom_update_namespace/main.cc
index 8aa4175..5b2aec7 100644
--- a/examples/dom_update_namespace/main.cc
+++ b/examples/dom_update_namespace/main.cc
@@ -72,7 +72,7 @@ class TestNamespace : public Tests
 
 TestNamespace::TestNamespace()
 :
-root_(0)
+root_(nullptr)
 {
   nsmap_["ns0"] = "http://default.namespace/root";;
   nsmap_["ns1"] = "http://default.namespace/child";;
diff --git a/examples/import_node/main.cc b/examples/import_node/main.cc
index 8c210d4..70ab801 100644
--- a/examples/import_node/main.cc
+++ b/examples/import_node/main.cc
@@ -43,7 +43,7 @@ int main (int /* argc */, char** /* argv */)
     Element* first_child2 = dynamic_cast<Element*>(child_list2.front());
     if (!first_child2)
     {
-      cerr << "first_child2 == 0" << endl;
+      cerr << "first_child2 == nullptr" << endl;
       return EXIT_FAILURE;
     }
     TextNode* text_to_add = first_child2->get_child_text();
diff --git a/examples/sax_parser_build_dom/svgparser.cc b/examples/sax_parser_build_dom/svgparser.cc
index 90a5ebf..af436b1 100644
--- a/examples/sax_parser_build_dom/svgparser.cc
+++ b/examples/sax_parser_build_dom/svgparser.cc
@@ -59,9 +59,9 @@ void Parser::on_start_element(const Glib::ustring& name,
     elementName = name.substr(idx + 1);
   }
 
-  xmlpp::Element* element_normal = 0;
+  xmlpp::Element* element_normal = nullptr;
   // Create a normal libxml++ node:
-  if (m_doc.get_root_node() == 0)
+  if (m_doc.get_root_node() == nullptr)
   {
     // Create the root node if necessary:
     element_normal = m_doc.create_root_node(elementName);
@@ -80,7 +80,7 @@ void Parser::on_start_element(const Glib::ustring& name,
   // node with the derived Element object we create below.
   xmlNode* node = element_normal->cobj(); //Save it for later.
   delete element_normal;
-  element_normal = 0;
+  element_normal = nullptr;
 
   // TODO: Again, this requires knowledge of the libxml++ implemenation -
   // specifically that the base xmlpp::Node() constructor will reassociate
@@ -90,7 +90,7 @@ void Parser::on_start_element(const Glib::ustring& name,
   // This will then be deleted by libxml++, just as libxml++ would normally have
   // deleted its own node.
   // TODO: Don't delete the original (above) if it isn't one of these node names.
-  xmlpp::Element* element_derived = 0;
+  xmlpp::Element* element_derived = nullptr;
   if (elementName == "g")
     element_derived = new SVG::Group(node);
   else if (elementName == "path")
diff --git a/libxml++/attribute.cc b/libxml++/attribute.cc
index c36428a..949afd5 100644
--- a/libxml++/attribute.cc
+++ b/libxml++/attribute.cc
@@ -37,7 +37,7 @@ Glib::ustring Attribute::get_value() const
     return attributeDecl->get_value();
 
   // AttributeNode
-  xmlChar* value = 0;
+  xmlChar* value = nullptr;
   if (cobj()->ns && cobj()->ns->href)
     value = xmlGetNsProp(cobj()->parent, cobj()->name, cobj()->ns->href);
   else
diff --git a/libxml++/document.cc b/libxml++/document.cc
index 90ffeea..5fd0567 100644
--- a/libxml++/document.cc
+++ b/libxml++/document.cc
@@ -118,7 +118,7 @@ void remove_found_wrappers(xmlNode* node, NodeMap& node_map)
       if (iter->second == node->type)
         node_map.erase(iter);
       else
-        node->_private = 0; // node->type has changed. The wrapper will be deleted.
+        node->_private = nullptr; // node->type has changed. The wrapper will be deleted.
     }
   }
 
@@ -226,7 +226,7 @@ void Document::set_internal_subset(const Glib::ustring& name,
 Element* Document::get_root_node() const
 {
   xmlNode* root = xmlDocGetRootElement(impl_);
-  if(root == 0)
+  if(root == nullptr)
     return 0;
   else
   {
@@ -368,7 +368,7 @@ Glib::ustring Document::do_write_to_string(
 {
   KeepBlanks k(KeepBlanks::Default);
   xmlIndentTreeOutput = format?1:0;
-  xmlChar* buffer = 0;
+  xmlChar* buffer = nullptr;
   int length = 0;
 
   xmlResetLastError();
diff --git a/libxml++/exceptions/exception.cc b/libxml++/exceptions/exception.cc
index d9a323d..b6401d2 100644
--- a/libxml++/exceptions/exception.cc
+++ b/libxml++/exceptions/exception.cc
@@ -87,7 +87,7 @@ Glib::ustring format_xml_error(const _xmlError* error)
 Glib::ustring format_xml_parser_error(const _xmlParserCtxt* parser_context)
 {
   if (!parser_context)
-    return "Error. xmlpp::format_xml_parser_error() called with parser_context == 0\n";
+    return "Error. xmlpp::format_xml_parser_error() called with parser_context == nullptr\n";
 
   const _xmlError* error = xmlCtxtGetLastError(const_cast<_xmlParserCtxt*>(parser_context));
 
diff --git a/libxml++/exceptions/exception.h b/libxml++/exceptions/exception.h
index c5afdc2..dffbe5a 100644
--- a/libxml++/exceptions/exception.h
+++ b/libxml++/exceptions/exception.h
@@ -62,7 +62,7 @@ private:
  * @returns A formatted text string. If the error struct does not contain an
  *          error (error->code == XML_ERR_OK), an empty string is returned.
  */
-Glib::ustring format_xml_error(const _xmlError* error = 0);
+Glib::ustring format_xml_error(const _xmlError* error = nullptr);
 
 /** Format a parser error into a text string, suitable for printing.
  *
diff --git a/libxml++/io/outputbuffer.cc b/libxml++/io/outputbuffer.cc
index 7f0beee..479f842 100644
--- a/libxml++/io/outputbuffer.cc
+++ b/libxml++/io/outputbuffer.cc
@@ -38,7 +38,7 @@ namespace xmlpp
     // The code is almost cut/paste from xmlSaveFormatFileEnc
     // TODO wrap the handler ? I don't think so but...
 
-    xmlCharEncodingHandlerPtr handler = 0;
+    xmlCharEncodingHandlerPtr handler = nullptr;
     if( ! encoding.empty() )
     {
       xmlCharEncoding enc = xmlParseCharEncoding(encoding.c_str());
@@ -49,7 +49,7 @@ namespace xmlpp
       if( enc != XML_CHAR_ENCODING_UTF8 )
       {
         handler = xmlFindCharEncodingHandler(encoding.c_str());
-        if(handler == 0)
+        if(handler == nullptr)
         {
           throw internal_error("Cannot initialise an encoder to " + encoding);
         }
@@ -61,7 +61,7 @@ namespace xmlpp
         &OutputBufferCallback::on_close,
         static_cast<void*>(this),
         handler);
-    if(impl_ == 0)
+    if(impl_ == nullptr)
     {
       throw internal_error("Cannot initialise underlying xmlOutputBuffer");
     }
@@ -76,7 +76,7 @@ namespace xmlpp
     bool result = do_close();
     // the underlying structure is being freed by libxml, the pointer will soon be
     // invalid.
-    impl_ = 0;
+    impl_ = nullptr;
 
     return result;
   }
diff --git a/libxml++/nodes/element.cc b/libxml++/nodes/element.cc
index ceb3cb9..0301f07 100644
--- a/libxml++/nodes/element.cc
+++ b/libxml++/nodes/element.cc
@@ -74,7 +74,7 @@ Glib::ustring Element::get_attribute_value(const Glib::ustring& name, const Glib
 Attribute* Element::set_attribute(const Glib::ustring& name, const Glib::ustring& value,
                                   const Glib::ustring& ns_prefix)
 {
-  xmlAttr* attr = 0;
+  xmlAttr* attr = nullptr;
 
   //Ignore the namespace if none was specified:
   if(ns_prefix.empty())
@@ -218,7 +218,7 @@ TextNode* Element::add_child_text_before(xmlpp::Node* next_sibling, const Glib::
 
 bool Element::has_child_text() const
 {
-  return get_child_text() != 0;
+  return get_child_text() != nullptr;
 }
 
 void Element::set_namespace_declaration(const Glib::ustring& ns_uri, const Glib::ustring& ns_prefix)
@@ -300,7 +300,7 @@ EntityReference* Element::add_child_entity_reference(const Glib::ustring& name)
 
   // Is it an entity reference or a character reference?
   // libxml uses xmlNode::type == XML_ENTITY_REF_NODE for both.
-  xmlNode* child = 0;
+  xmlNode* child = nullptr;
   if (extended_name[ichar] == '#')
     child = xmlNewCharRef(cobj()->doc, (const xmlChar*)name.c_str());
   else
diff --git a/libxml++/nodes/node.cc b/libxml++/nodes/node.cc
index 5664f3b..9c084be 100644
--- a/libxml++/nodes/node.cc
+++ b/libxml++/nodes/node.cc
@@ -184,7 +184,7 @@ Node* Node::get_previous_sibling()
 
 static Node* _convert_node(xmlNode* node)
 {
-  Node* res = 0;
+  Node* res = nullptr;
   if(node)
   {
     Node::create_wrapper(node);
@@ -302,7 +302,7 @@ Element* Node::add_child_before_with_new_ns(xmlpp::Node* next_sibling,
 
 _xmlNode* Node::create_new_child_node(const Glib::ustring& name, const Glib::ustring& ns_prefix)
 {
-   xmlNs* ns = 0;
+   xmlNs* ns = nullptr;
 
    if(impl_->type != XML_ELEMENT_NODE)
    {
@@ -345,7 +345,7 @@ _xmlNode* Node::create_new_child_node_with_new_ns(const Glib::ustring& name,
   {
     ns = xmlSearchNs(impl_->doc, impl_, (const xmlChar*)ns_prefix.c_str());
     if (ns && (ns_uri != (ns->href ? (const char*)ns->href : "")))
-      ns = 0;
+      ns = nullptr;
   }
   if (!ns)
   {
@@ -749,21 +749,21 @@ void Node::free_wrappers(xmlNode* node)
     //Node types that have no properties
     case XML_DTD_NODE:
       delete static_cast<Dtd*>(node->_private);
-      node->_private = 0;
+      node->_private = nullptr;
       return;
     case XML_ATTRIBUTE_NODE:
     case XML_ELEMENT_DECL:
     case XML_ATTRIBUTE_DECL:
     case XML_ENTITY_DECL:
       delete static_cast<Node*>(node->_private);
-      node->_private = 0;
+      node->_private = nullptr;
       return;
     case XML_DOCUMENT_NODE:
       //Do not free now. The Document is usually the one who owns the caller.
       return;
     default:
       delete static_cast<Node*>(node->_private);
-      node->_private = 0;
+      node->_private = nullptr;
       break;
   }
 
diff --git a/libxml++/nodes/node.h b/libxml++/nodes/node.h
index 5d97a6b..74d0f0e 100644
--- a/libxml++/nodes/node.h
+++ b/libxml++/nodes/node.h
@@ -307,7 +307,7 @@ public:
    *
    * @newin{2,36}
    */
-  bool eval_to_boolean(const Glib::ustring& xpath, XPathResultType* result_type = 0) const;
+  bool eval_to_boolean(const Glib::ustring& xpath, XPathResultType* result_type = nullptr) const;
 
 
   /** Evaluate an XPath expression.
@@ -323,7 +323,7 @@ public:
    * @newin{2,36}
    */
   bool eval_to_boolean(const Glib::ustring& xpath, const PrefixNsMap& namespaces,
-    XPathResultType* result_type = 0) const;
+    XPathResultType* result_type = nullptr) const;
 
   /** Evaluate an XPath expression.
    * @param xpath The XPath expression.
@@ -336,7 +336,7 @@ public:
    *
    * @newin{2,36}
    */
-  double eval_to_number(const Glib::ustring& xpath, XPathResultType* result_type = 0) const;
+  double eval_to_number(const Glib::ustring& xpath, XPathResultType* result_type = nullptr) const;
 
   /** Evaluate an XPath expression.
    * @param xpath The XPath expression.
@@ -351,7 +351,7 @@ public:
    * @newin{2,36}
    */
   double eval_to_number(const Glib::ustring& xpath, const PrefixNsMap& namespaces,
-    XPathResultType* result_type = 0) const;
+    XPathResultType* result_type = nullptr) const;
 
   /** Evaluate an XPath expression.
    * @param xpath The XPath expression.
@@ -364,7 +364,7 @@ public:
    *
    * @newin{2,36}
    */
-  Glib::ustring eval_to_string(const Glib::ustring& xpath, XPathResultType* result_type = 0) const;
+  Glib::ustring eval_to_string(const Glib::ustring& xpath, XPathResultType* result_type = nullptr) const;
 
   /** Evaluate an XPath expression.
    * @param xpath The XPath expression.
@@ -379,7 +379,7 @@ public:
    * @newin{2,36}
    */
   Glib::ustring eval_to_string(const Glib::ustring& xpath, const PrefixNsMap& namespaces,
-    XPathResultType* result_type = 0) const;
+    XPathResultType* result_type = nullptr) const;
 
   ///Access the underlying libxml implementation.
   _xmlNode* cobj();
diff --git a/libxml++/parsers/domparser.cc b/libxml++/parsers/domparser.cc
index f1aaa52..ca46bbf 100644
--- a/libxml++/parsers/domparser.cc
+++ b/libxml++/parsers/domparser.cc
@@ -20,14 +20,14 @@ namespace xmlpp
 {
 
 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);
@@ -53,7 +53,7 @@ void DomParser::parse_file(const Glib::ustring& 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());
   }
@@ -123,7 +123,7 @@ void DomParser::parse_context()
   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?
@@ -196,7 +196,7 @@ void DomParser::parse_stream(std::istream& in)
   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:
@@ -209,7 +209,7 @@ void DomParser::release_underlying()
   if(doc_)
   {
     delete doc_;
-    doc_ = 0;
+    doc_ = nullptr;
   }
 
   Parser::release_underlying();
@@ -217,7 +217,7 @@ void DomParser::release_underlying()
 
 DomParser::operator bool() const
 {
-  return doc_ != 0;
+  return doc_ != nullptr;
 }
 
 Document* DomParser::get_document()
diff --git a/libxml++/parsers/parser.cc b/libxml++/parsers/parser.cc
index f6f4fce..82fa9be 100644
--- a/libxml++/parsers/parser.cc
+++ b/libxml++/parsers/parser.cc
@@ -61,7 +61,7 @@ void on_parser_warning(const xmlpp::Parser* parser, const Glib::ustring& message
 namespace xmlpp {
 
 Parser::Parser()
-: context_(0), exception_(0), validate_(false), substitute_entities_(false) //See doxygen comment on 
set_substiute_entities().
+: context_(nullptr), exception_(nullptr), validate_(false), substitute_entities_(false) //See doxygen 
comment on set_substiute_entities().
 {
 
 }
@@ -201,15 +201,15 @@ void Parser::release_underlying()
 {
   if(context_)
   {
-    context_->_private = 0; //Not really necessary.
+    context_->_private = nullptr; //Not really necessary.
     
-    if( context_->myDoc != 0 )
+    if( context_->myDoc != nullptr )
     {
       xmlFreeDoc(context_->myDoc);
     }
 
     xmlFreeParserCtxt(context_);
-    context_ = 0;
+    context_ = nullptr;
   }
 }
 
@@ -372,7 +372,7 @@ void Parser::check_for_exception()
   if(exception_)
   {
     std::auto_ptr<exception> tmp ( exception_ );
-    exception_ = 0;
+    exception_ = nullptr;
     tmp->Raise();
   }
 }
diff --git a/libxml++/parsers/saxparser.cc b/libxml++/parsers/saxparser.cc
index 204dd7d..fbd79b8 100644
--- a/libxml++/parsers/saxparser.cc
+++ b/libxml++/parsers/saxparser.cc
@@ -374,7 +374,7 @@ xmlEntityPtr SaxParserCallback::get_entity(void* context, const xmlChar* name)
 {
   _xmlParserCtxt* the_context = static_cast<_xmlParserCtxt*>(context);
   SaxParser* parser = static_cast<SaxParser*>(the_context->_private);
-  xmlEntityPtr result = 0;
+  xmlEntityPtr result = nullptr;
 
   try
   {
diff --git a/libxml++/parsers/textreader.cc b/libxml++/parsers/textreader.cc
index c041cd4..d220cf2 100644
--- a/libxml++/parsers/textreader.cc
+++ b/libxml++/parsers/textreader.cc
@@ -346,8 +346,8 @@ bool TextReader::is_valid() const
 
 void TextReader::setup_exceptions()
 {
-  xmlTextReaderErrorFunc func = 0;
-  void* arg = 0; 
+  xmlTextReaderErrorFunc func = nullptr;
+  void* arg = nullptr; 
 
   // We respect any other error handlers already setup:
   xmlTextReaderGetErrorHandler(impl_, &func, &arg);
diff --git a/libxml++/relaxngschema.cc b/libxml++/relaxngschema.cc
index a747bf6..96bd880 100644
--- a/libxml++/relaxngschema.cc
+++ b/libxml++/relaxngschema.cc
@@ -44,7 +44,7 @@ namespace xmlpp
 
 struct RelaxNGSchema::Impl
 {
-  Impl() : schema(0) {}
+  Impl() : schema(nullptr) {}
 
   _xmlRelaxNG* schema;
 };
@@ -127,7 +127,7 @@ void RelaxNGSchema::release_underlying()
   if (pimpl_->schema)
   {
     xmlRelaxNGFree(pimpl_->schema);
-    pimpl_->schema = 0;
+    pimpl_->schema = nullptr;
   }
 }
 
diff --git a/libxml++/schema.cc b/libxml++/schema.cc
index 8708ba9..ac1afc8 100644
--- a/libxml++/schema.cc
+++ b/libxml++/schema.cc
@@ -25,7 +25,7 @@ Schema::Schema(_xmlSchema* schema)
 }
 
 Schema::Schema(Document* document, bool embed)
-: impl_(0)
+: impl_(nullptr)
 , embedded_doc_(false)
 {
   set_document(document, embed);
@@ -97,7 +97,7 @@ void Schema::release_underlying()
   if(impl_)
   {
     xmlSchemaFree(impl_);
-    impl_ = 0;
+    impl_ = nullptr;
   }
 }
 
diff --git a/libxml++/validators/dtdvalidator.cc b/libxml++/validators/dtdvalidator.cc
index 133c75e..14c6c27 100644
--- a/libxml++/validators/dtdvalidator.cc
+++ b/libxml++/validators/dtdvalidator.cc
@@ -22,18 +22,18 @@ namespace xmlpp
 {
 
 DtdValidator::DtdValidator()
-: dtd_(0)
+: dtd_(nullptr)
 {
 }
 
 DtdValidator::DtdValidator(const Glib::ustring& file)
-: dtd_(0)
+: dtd_(nullptr)
 {
   parse_subset("",file);
 }
 
 DtdValidator::DtdValidator(const Glib::ustring& external,const Glib::ustring& system)
-: dtd_(0)
+: dtd_(nullptr)
 {
   parse_subset(external,system);
 }
@@ -102,13 +102,13 @@ void DtdValidator::release_underlying()
     xmlDtd* dtd = dtd_->cobj();
     Node::free_wrappers(reinterpret_cast<xmlNode*>(dtd));
     xmlFreeDtd(dtd);
-    dtd_ = 0;
+    dtd_ = nullptr;
   }
 }
 
 DtdValidator::operator bool() const
 {
-  return dtd_ != 0;
+  return dtd_ != nullptr;
 }
 
 Dtd* DtdValidator::get_dtd()
diff --git a/libxml++/validators/relaxngvalidator.cc b/libxml++/validators/relaxngvalidator.cc
index d16a197..6d01e10 100644
--- a/libxml++/validators/relaxngvalidator.cc
+++ b/libxml++/validators/relaxngvalidator.cc
@@ -29,7 +29,7 @@ namespace xmlpp
 
 struct RelaxNGValidator::Impl
 {
-  Impl() : schema(0), is_schema_owner(false), context(0) {}
+  Impl() : schema(nullptr), is_schema_owner(false), context(nullptr) {}
 
   RelaxNGSchema* schema;
   bool is_schema_owner;
@@ -94,14 +94,14 @@ void RelaxNGValidator::release_underlying()
   if (pimpl_->context)
   {
     xmlRelaxNGFreeValidCtxt(pimpl_->context);
-    pimpl_->context = 0;
+    pimpl_->context = nullptr;
   }
 
   if (pimpl_->schema)
   {
     if (pimpl_->is_schema_owner)
       delete pimpl_->schema;
-    pimpl_->schema = 0;
+    pimpl_->schema = nullptr;
   }
 
   SchemaValidatorBase::release_underlying();
diff --git a/libxml++/validators/schemavalidator.cc b/libxml++/validators/schemavalidator.cc
index 8c678db..2b2cb5c 100644
--- a/libxml++/validators/schemavalidator.cc
+++ b/libxml++/validators/schemavalidator.cc
@@ -38,24 +38,24 @@ namespace xmlpp
 {
 
 SchemaValidator::SchemaValidator()
-: schema_(0)
+: schema_(nullptr)
 , embbeded_shema_(false)
-, ctxt_(0)
+, ctxt_(nullptr)
 {
 }
 
 SchemaValidator::SchemaValidator(const Glib::ustring& file)
-: schema_(0)
+: schema_(nullptr)
 , embbeded_shema_(false)
-, ctxt_(0)
+, ctxt_(nullptr)
 {
   parse_file( file );
 }
 
 SchemaValidator::SchemaValidator(Document& document)
-: schema_(0)
+: schema_(nullptr)
 , embbeded_shema_(false)
-, ctxt_(0)
+, ctxt_(nullptr)
 {
   parse_document( document );
 }
@@ -63,7 +63,7 @@ SchemaValidator::SchemaValidator(Document& document)
 SchemaValidator::SchemaValidator(Schema* schema)
 : schema_(schema)
 , embbeded_shema_(false)
-, ctxt_(0)
+, ctxt_(nullptr)
 {
 }
 
@@ -126,19 +126,19 @@ void SchemaValidator::release_underlying()
   if(ctxt_)
   {
     xmlSchemaFreeValidCtxt( ctxt_ );
-    ctxt_ = 0;
+    ctxt_ = nullptr;
   }
   if(schema_)
   {
     if(embbeded_shema_)
       delete schema_;
-    schema_ = 0;
+    schema_ = nullptr;
   }
 }
 
 SchemaValidator::operator bool() const
 {
-  return schema_ != 0;
+  return schema_ != nullptr;
 }
 
 Schema* SchemaValidator::get_schema()
diff --git a/libxml++/validators/validator.cc b/libxml++/validators/validator.cc
index 55e3e41..30fbb79 100644
--- a/libxml++/validators/validator.cc
+++ b/libxml++/validators/validator.cc
@@ -15,7 +15,7 @@
 namespace xmlpp {
 
 Validator::Validator()
-: valid_(0), exception_(0)
+: valid_(nullptr), exception_(nullptr)
 {
 }
 
@@ -47,10 +47,10 @@ void Validator::release_underlying()
 {
   if(valid_)
   {
-    valid_->userData = 0; //Not really necessary.
+    valid_->userData = nullptr; //Not really necessary.
 
     xmlFreeValidCtxt(valid_);
-    valid_ = 0;
+    valid_ = nullptr;
   }
 }
 
@@ -166,7 +166,7 @@ void Validator::check_for_exception()
   if(exception_)
   {
     std::auto_ptr<exception> tmp(exception_);
-    exception_ = 0;
+    exception_ = nullptr;
     tmp->Raise();
   }
 }
diff --git a/libxml++/validators/xsdvalidator.cc b/libxml++/validators/xsdvalidator.cc
index f213438..669555c 100644
--- a/libxml++/validators/xsdvalidator.cc
+++ b/libxml++/validators/xsdvalidator.cc
@@ -26,7 +26,7 @@ namespace xmlpp
 
 struct XsdValidator::Impl
 {
-  Impl() : schema(0), is_schema_owner(false), context(0) {}
+  Impl() : schema(nullptr), is_schema_owner(false), context(nullptr) {}
 
   XsdSchema* schema;
   bool is_schema_owner;
@@ -91,14 +91,14 @@ void XsdValidator::release_underlying()
   if (pimpl_->context)
   {
     xmlSchemaFreeValidCtxt(pimpl_->context);
-    pimpl_->context = 0;
+    pimpl_->context = nullptr;
   }
 
   if (pimpl_->schema)
   {
     if (pimpl_->is_schema_owner)
       delete pimpl_->schema;
-    pimpl_->schema = 0;
+    pimpl_->schema = nullptr;
   }
 
   SchemaValidatorBase::release_underlying();
diff --git a/libxml++/xsdschema.cc b/libxml++/xsdschema.cc
index be7671d..94a9238 100644
--- a/libxml++/xsdschema.cc
+++ b/libxml++/xsdschema.cc
@@ -42,7 +42,7 @@ namespace xmlpp
 
 struct XsdSchema::Impl
 {
-  Impl() : schema(0), document(0) {}
+  Impl() : schema(nullptr), document(nullptr) {}
 
   _xmlSchema* schema;
   _xmlDoc* document;
@@ -137,13 +137,13 @@ void XsdSchema::release_underlying()
   if (pimpl_->schema)
   {
     xmlSchemaFree(pimpl_->schema);
-    pimpl_->schema = 0;
+    pimpl_->schema = nullptr;
   }
 
   if (pimpl_->document)
   {
     xmlFreeDoc(pimpl_->document);
-    pimpl_->document = 0;
+    pimpl_->document = nullptr;
   }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]