MCPcopy Create free account
hub / github.com/beginner-jhj/mini_browser / NODE

Method NODE

src/html/node.cpp:12–24  ·  view source on GitHub ↗

* \brief Constructs a DOM Node with type and content. * * Creates either an ELEMENT node with a tag name or a TEXT node with text content. * The constructor determines the node type and stores the appropriate value. * * \param t The node type (ELEMENT or TEXT). * \param content The tag name (if ELEMENT) or text content (if TEXT). */

Source from the content-addressed store, hash-verified

10 * \param content The tag name (if ELEMENT) or text content (if TEXT).
11 */
12NODE::NODE(NODE_TYPE t, const std::string &content) : m_type(t)
13{
14 if (t == NODE_TYPE::ELEMENT)
15 {
16 m_tag_name = content;
17 m_text = "";
18 }
19 else
20 {
21 m_text = content;
22 m_tag_name = "";
23 }
24}
25
26/**
27 * \brief Adds a child node and establishes parent-child relationship.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected