NovaSVG 0.11.5
An SVG library
Loading...
Searching...
No Matches
nova::svg::node Class Reference

#include <svg.h>

Inheritance diagram for nova::svg::node:

Public Member Functions

 node ()=default
 Constructs a null nd.
bool is_text_node () const
 Checks if the nd is a text nd.
bool is_element () const
 Checks if the nd is an el nd.
text_node to_text_node () const
 Converts the nd to a text_node.
element to_element () const
 Converts the nd to an element.
element parent_element () const
 Returns the parent el.
bool is_null () const
 Checks if the nd is null.
 operator bool () const
 Checks if the nd is not null.
bool operator== (const node &nd) const
 Checks if two nodes are equal.
bool operator!= (const node &nd) const
 Checks if two nodes are not equal.

Protected Member Functions

 node (svg_node *nd)
svg_node * nd () const

Protected Attributes

svg_node * m_node {nullptr}

Friends

class element

Detailed Description

Definition at line 95 of file svg.h.

Constructor & Destructor Documentation

◆ node() [1/2]

nova::svg::node::node ( )
default

Constructs a null nd.

Referenced by operator!=(), and operator==().

◆ node() [2/2]

nova::svg::node::node ( svg_node * nd)
protected

References nd().

Member Function Documentation

◆ is_element()

bool nova::svg::node::is_element ( ) const

Checks if the nd is an el nd.

Returns
True if the nd is an el nd, false otherwise.

◆ is_null()

bool nova::svg::node::is_null ( ) const
inline

Checks if the nd is null.

Returns
True if the nd is null, false otherwise.

Definition at line 136 of file svg.h.

References m_node.

Referenced by operator bool().

◆ is_text_node()

bool nova::svg::node::is_text_node ( ) const

Checks if the nd is a text nd.

Returns
True if the nd is a text nd, false otherwise.

◆ nd()

svg_node * nova::svg::node::nd ( ) const
inlineprotected

Definition at line 160 of file svg.h.

References m_node.

Referenced by node(), operator!=(), and operator==().

◆ operator bool()

nova::svg::node::operator bool ( ) const
inline

Checks if the nd is not null.

Returns
True if the nd is not null, false otherwise.

Definition at line 142 of file svg.h.

References is_null().

◆ operator!=()

bool nova::svg::node::operator!= ( const node & nd) const
inline

Checks if two nodes are not equal.

Parameters
elThe nd to compare.
Returns
True if not equal, otherwise false.

Definition at line 156 of file svg.h.

References m_node, nd(), and node().

◆ operator==()

bool nova::svg::node::operator== ( const node & nd) const
inline

Checks if two nodes are equal.

Parameters
elThe nd to compare.
Returns
True if equal, otherwise false.

Definition at line 149 of file svg.h.

References m_node, nd(), and node().

◆ parent_element()

element nova::svg::node::parent_element ( ) const

Returns the parent el.

Returns
The parent el of this nd. If this nd has no parent, a null element is returned.

References element.

◆ to_element()

element nova::svg::node::to_element ( ) const

Converts the nd to an element.

Returns
An element or a null nd if conversion is not possible.

References element.

◆ to_text_node()

text_node nova::svg::node::to_text_node ( ) const

Converts the nd to a text_node.

Returns
A text_node or a null nd if conversion is not possible.

◆ element

friend class element
friend

Definition at line 162 of file svg.h.

References element.

Referenced by element, parent_element(), and to_element().

Member Data Documentation

◆ m_node

svg_node* nova::svg::node::m_node {nullptr}
protected

Definition at line 161 of file svg.h.

Referenced by is_null(), nd(), operator!=(), and operator==().


The documentation for this class was generated from the following file:
  • /home/runner/work/novasvg/novasvg/include/nova/svg/svg.h