rapidyaml  0.7.0
parse and emit YAML, and do it fast
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 1045 of file tree.hpp.

Constructor & Destructor Documentation

◆ lookup_result() [1/2]

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

Definition at line 1054 of file tree.hpp.

◆ lookup_result() [2/2]

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

Definition at line 1055 of file tree.hpp.

1055 : 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 1052 of file tree.hpp.

1052 { return target != NONE; }

References c4::yml::NONE.

◆ resolved()

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

get the part ot the input path that was resolved

Definition at line 1455 of file tree.cpp.

1456 {
1457  csubstr p = path.first(path_pos);
1458  if(p.ends_with('.'))
1459  p = p.first(p.len-1);
1460  return p;
1461 }

References path, and path_pos.

◆ unresolved()

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

get the part ot the input path that was unresolved

Definition at line 1463 of file tree.cpp.

1464 {
1465  return path.sub(path_pos);
1466 }

Member Data Documentation

◆ target

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

Definition at line 1047 of file tree.hpp.

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

◆ closest

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

Definition at line 1048 of file tree.hpp.

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

◆ path_pos

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

Definition at line 1049 of file tree.hpp.

Referenced by resolved().

◆ path

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

Definition at line 1050 of file tree.hpp.

Referenced by resolved().


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