rapidyaml  0.16.0
parseandemitYAML,anddoitfast
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 More...
 
csubstr unresolved () const
 get the part ot the input path that was unresolved More...
 

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

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

Definition at line 1477 of file tree.hpp.

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_) {}
an index to none
Definition: common.hpp:131

Member Function Documentation

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

Definition at line 1475 of file tree.hpp.

1475 { return target != NONE; }
an index to none
Definition: common.hpp:131
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 first(size_t num) const noexcept
return the first num elements: [0,num[
Definition: substr.hpp:529
basic_substring< const char > csubstr
an immutable string view
Definition: substr.hpp:2356
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 }
basic_substring sub(size_t first) const noexcept
return [first,len[
Definition: substr.hpp:502

Member Data Documentation

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

Definition at line 1470 of file tree.hpp.

Referenced by c4::yml::Tree::lookup_path().

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

Definition at line 1471 of file tree.hpp.

Referenced by c4::yml::Tree::lookup_path().

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

Definition at line 1472 of file tree.hpp.

Referenced by resolved().

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

Definition at line 1473 of file tree.hpp.

Referenced by resolved().


The documentation for this struct was generated from the following files: