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)
 AstNode (const AstNode &)=default
AstNodeoperator= (const AstNode &)=default
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 481 of file inja.hpp.

Constructor & Destructor Documentation

◆ DataNode()

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

Definition at line 497 of file inja.hpp.

499 , name(ptr_name)
500 , ptr(json::json_pointer(convert_dot_to_ptr(ptr_name))) {
501 }
size_t pos
Definition inja.hpp:418
static std::string convert_dot_to_ptr(std::string_view ptr_name)
Definition inja.hpp:486
const json::json_pointer ptr
Definition inja.hpp:484
const std::string name
Definition inja.hpp:483
ExpressionNode(size_t pos)
Definition inja.hpp:458

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 503 of file inja.hpp.

503 {
504 v.visit(*this);
505 }

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 486 of file inja.hpp.

486 {
487 std::string result;
488 do {
489 std::string_view part;
490 std::tie(part, ptr_name) = string_view::split(ptr_name, '.');
491 result.push_back('/');
492 result.append(part.begin(), part.end());
493 } while (!ptr_name.empty());
494 return result;
495 }
std::pair< std::string_view, std::string_view > split(std::string_view view, char Separator)
Definition inja.hpp:317

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 484 of file inja.hpp.

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


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