MQTTSuite
Loading...
Searching...
No Matches
inja::DataNode Class Reference

#include <inja.hpp>

Inheritance diagram for inja::DataNode:
Collaboration diagram for inja::DataNode:

Public Member Functions

 DataNode (std::string_view ptr_name, size_t pos)
void accept (NodeVisitor &v) const override
Public Member Functions inherited from inja::ExpressionNode
 ExpressionNode (size_t pos)
void accept (NodeVisitor &v) const override
Public Member Functions inherited from inja::AstNode
 AstNode (size_t pos)
virtual ~AstNode ()

Static Public Member Functions

static std::string convert_dot_to_ptr (std::string_view ptr_name)

Public Attributes

const std::string name
const json::json_pointer ptr
Public Attributes inherited from inja::AstNode
size_t pos

Detailed Description

Definition at line 508 of file inja.hpp.

Constructor & Destructor Documentation

◆ DataNode()

inja::DataNode::DataNode ( std::string_view ptr_name,
size_t pos )
inlineexplicit

Definition at line 524 of file inja.hpp.

526 , name(ptr_name)
527 , ptr(json::json_pointer(convert_dot_to_ptr(ptr_name))) {
528 }
size_t pos
Definition inja.hpp:447
static std::string convert_dot_to_ptr(std::string_view ptr_name)
Definition inja.hpp:513
const json::json_pointer ptr
Definition inja.hpp:511
const std::string name
Definition inja.hpp:510
ExpressionNode(size_t pos)
Definition inja.hpp:485

References convert_dot_to_ptr(), inja::ExpressionNode::ExpressionNode(), name, and ptr.

Here is the call graph for this function:

Member Function Documentation

◆ accept()

void inja::DataNode::accept ( NodeVisitor & v) const
inlineoverridevirtual

Implements inja::AstNode.

Definition at line 530 of file inja.hpp.

530 {
531 v.visit(*this);
532 }

References inja::NodeVisitor::visit().

Here is the call graph for this function:

◆ convert_dot_to_ptr()

std::string inja::DataNode::convert_dot_to_ptr ( std::string_view ptr_name)
inlinestatic

Definition at line 513 of file inja.hpp.

513 {
514 std::string result;
515 do {
516 std::string_view part;
517 std::tie(part, ptr_name) = string_view::split(ptr_name, '.');
518 result.push_back('/');
519 result.append(part.begin(), part.end());
520 } while (!ptr_name.empty());
521 return result;
522 }
std::pair< std::string_view, std::string_view > split(std::string_view view, char Separator)
Definition inja.hpp:344

References inja::string_view::split().

Referenced by DataNode(), and inja::Renderer::visit().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ name

◆ ptr

const json::json_pointer inja::DataNode::ptr

Definition at line 511 of file inja.hpp.

Referenced by DataNode(), and inja::Renderer::visit().


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