: impl_(node)
{
if (!impl_)
- throw internal_error("xmlNode pointer cannot be 0");
+ throw internal_error("xmlNode pointer cannot be nullptr");
impl_->_private = this;
}
Element* Node::get_parent()
{
if(!(cobj()->parent && cobj()->parent->type == XML_ELEMENT_NODE))
- return 0;
+ return nullptr;
Node::create_wrapper(cobj()->parent);
return static_cast<Element*>(cobj()->parent->_private);
Node* Node::get_next_sibling()
{
if(!cobj()->next)
- return 0;
+ return nullptr;
Node::create_wrapper(cobj()->next);
return static_cast<Node*>(cobj()->next->_private);
Node* Node::get_previous_sibling()
{
if(!cobj()->prev)
- return 0;
+ return nullptr;
Node::create_wrapper(cobj()->prev);
return static_cast<Node*>(cobj()->prev->_private);
{
auto child = impl_->children;
if(!child)
- return 0;
+ return nullptr;
do
{
}
while((child = child->next));
- return 0;
+ return nullptr;
}
const Node* Node::get_first_child(const Glib::ustring& name) const
Node* Node::import_node(const Node* node, bool recursive)
{
if (!node)
- return 0;
+ return nullptr;
//Create the node, by copying:
auto imported_node = xmlDocCopyNode(const_cast<xmlNode*>(node->cobj()), impl_->doc, recursive);
if (imported_node->type == XML_ATTRIBUTE_NODE && impl_->type == XML_ELEMENT_NODE)
{
auto old_attr = xmlHasNsProp(impl_, imported_node->name,
- imported_node->ns ? imported_node->ns->href : 0);
+ imported_node->ns ? imported_node->ns->href : nullptr);
if (old_attr && old_attr->type != XML_ATTRIBUTE_DECL)
{
// *this has an attribute with the same name as the imported attribute.
Node::NodeSet Node::find(const Glib::ustring& xpath)
{
- return find_common<NodeSet>(xpath, 0, impl_);
+ return find_common<NodeSet>(xpath, nullptr, impl_);
}
Node::const_NodeSet Node::find(const Glib::ustring& xpath) const
{
- return find_common<const_NodeSet>(xpath, 0, impl_);
+ return find_common<const_NodeSet>(xpath, nullptr, impl_);
}
Node::NodeSet Node::find(const Glib::ustring& xpath, const PrefixNsMap& namespaces)
bool Node::eval_to_boolean(const Glib::ustring& xpath, XPathResultType* result_type) const
{
- return eval_common_to_boolean(xpath, 0, result_type, impl_);
+ return eval_common_to_boolean(xpath, nullptr, result_type, impl_);
}
bool Node::eval_to_boolean(const Glib::ustring& xpath, const PrefixNsMap& namespaces,
double Node::eval_to_number(const Glib::ustring& xpath, XPathResultType* result_type) const
{
- return eval_common_to_number(xpath, 0, result_type, impl_);
+ return eval_common_to_number(xpath, nullptr, result_type, impl_);
}
double Node::eval_to_number(const Glib::ustring& xpath, const PrefixNsMap& namespaces,
Glib::ustring Node::eval_to_string(const Glib::ustring& xpath, XPathResultType* result_type) const
{
- return eval_common_to_string(xpath, 0, result_type, impl_);
+ return eval_common_to_string(xpath, nullptr, result_type, impl_);
}
Glib::ustring Node::eval_to_string(const Glib::ustring& xpath, const PrefixNsMap& namespaces,
}
//Look for the existing namespace to use:
- auto ns = xmlSearchNs( cobj()->doc, cobj(), (xmlChar*)(ns_prefix.empty() ? 0 : ns_prefix.c_str()) );
+ auto ns = xmlSearchNs( cobj()->doc, cobj(), (xmlChar*)(ns_prefix.empty() ? nullptr : ns_prefix.c_str()) );
if(ns)
{
//Use it for this element: