NovaSVG 0.10.0
A header-only SVG library
Loading...
Searching...
No Matches
novasvg::TextNode Class Reference

#include <novasvg.h>

Inheritance diagram for novasvg::TextNode:
Collaboration diagram for novasvg::TextNode:

Public Member Functions

 TextNode ()=default
 Constructs a null text node.
 
const std::string & data () const
 Returns the text content of the node.
 
void setData (const std::string &data)
 Sets the text content of the node.
 
- Public Member Functions inherited from novasvg::Node
 Node ()=default
 Constructs a null node.
 
bool isTextNode () const
 Checks if the node is a text node.
 
bool isElement () const
 Checks if the node is an element node.
 
TextNode toTextNode () const
 Converts the node to a TextNode.
 
Element toElement () const
 Converts the node to an Element.
 
Element parentElement () const
 Returns the parent element.
 
bool isNull () const
 Checks if the node is null.
 
 operator bool () const
 Checks if the node is not null.
 
bool operator== (const Node &node) const
 Checks if two nodes are equal.
 
bool operator!= (const Node &node) const
 Checks if two nodes are not equal.
 

Friends

class Node
 

Additional Inherited Members

- Protected Member Functions inherited from novasvg::Node
 Node (SVGNode *node)
 
SVGNode * node () const
 
- Protected Attributes inherited from novasvg::Node
SVGNode * m_node {nullptr}
 

Detailed Description

Definition at line 435 of file novasvg.h.

Constructor & Destructor Documentation

◆ TextNode()

novasvg::TextNode::TextNode ( )
default

Constructs a null text node.

Member Function Documentation

◆ data()

const std::string & novasvg::TextNode::data ( ) const
inline

Returns the text content of the node.

Returns
A string representing the text content.

Definition at line 879 of file novasvg.h.

References novasvg::SVGTextNode::data(), novasvg::emptyString, and novasvg::Node::m_node.

Referenced by setData().

◆ setData()

void novasvg::TextNode::setData ( const std::string &  data)
inline

Sets the text content of the node.

Parameters
dataThe new text content to set.

Definition at line 886 of file novasvg.h.

References data(), novasvg::Node::m_node, and novasvg::SVGTextNode::setData().

Friends And Related Symbol Documentation

◆ Node

friend class Node
friend

Definition at line 457 of file novasvg.h.


The documentation for this class was generated from the following file: