rapidyaml 0.15.2
parse and emit YAML, and do it fast
Loading...
Searching...
No Matches
c4::yml::Tree::lookup_result Struct Reference

#include <tree.hpp>

Public Member Functions

 operator bool () const
 lookup_result ()
 lookup_result (csubstr path_, id_type start)
csubstr resolved () const
 get the part ot the input path that was resolved
csubstr unresolved () const
 get the part ot the input path that was unresolved

Public Attributes

id_type target
id_type closest
size_t path_pos
csubstr path

Detailed Description

Definition at line 1468 of file tree.hpp.

Constructor & Destructor Documentation

◆ lookup_result() [1/2]

c4::yml::Tree::lookup_result::lookup_result ( )
inline

Definition at line 1477 of file tree.hpp.

◆ lookup_result() [2/2]

c4::yml::Tree::lookup_result::lookup_result ( csubstr path_,
id_type start )
inline

Definition at line 1478 of file tree.hpp.

1478: target(NONE), closest(start), path_pos(0), path(path_) {}

Member Function Documentation

◆ operator bool()

c4::yml::Tree::lookup_result::operator bool ( ) const
inline

Definition at line 1475 of file tree.hpp.

1475{ return target != NONE; }

◆ resolved()

csubstr c4::yml::Tree::lookup_result::resolved ( ) const

get the part ot the input path that was resolved

Definition at line 1588 of file tree.cpp.

1589{
1590 csubstr p = path.first(path_pos);
1591 if(p.ends_with('.'))
1592 p = p.first(p.len-1);
1593 return p;
1594}
basic_substring< const char > csubstr
an immutable string view
Definition substr.hpp:2356

◆ unresolved()

csubstr c4::yml::Tree::lookup_result::unresolved ( ) const

get the part ot the input path that was unresolved

Definition at line 1596 of file tree.cpp.

1597{
1598 return path.sub(path_pos);
1599}

Member Data Documentation

◆ target

id_type c4::yml::Tree::lookup_result::target

Definition at line 1470 of file tree.hpp.

Referenced by lookup_result(), lookup_result(), c4::yml::Tree::lookup_path(), and operator bool().

◆ closest

id_type c4::yml::Tree::lookup_result::closest

Definition at line 1471 of file tree.hpp.

Referenced by lookup_result(), lookup_result(), and c4::yml::Tree::lookup_path().

◆ path_pos

size_t c4::yml::Tree::lookup_result::path_pos

Definition at line 1472 of file tree.hpp.

Referenced by lookup_result(), lookup_result(), resolved(), and unresolved().

◆ path

csubstr c4::yml::Tree::lookup_result::path

Definition at line 1473 of file tree.hpp.

Referenced by lookup_result(), lookup_result(), resolved(), and unresolved().


The documentation for this struct was generated from the following files:
  • /home/docs/checkouts/readthedocs.org/user_builds/rapidyaml/checkouts/latest/src/c4/yml/tree.hpp
  • /home/docs/checkouts/readthedocs.org/user_builds/rapidyaml/checkouts/latest/src/c4/yml/tree.cpp