rcl_yaml_param_parser  master
Parse a YAML parameter file and populate the C data structure.
All Classes Namespaces Files Functions Variables
parser.h
1 // Copyright 2018 Apex.AI, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
27 #ifndef RCL_YAML_PARAM_PARSER__PARSER_H_
28 #define RCL_YAML_PARAM_PARSER__PARSER_H_
29 
30 #include <stdlib.h>
31 
32 #include "rcl_yaml_param_parser/types.h"
33 #include "rcl_yaml_param_parser/visibility_control.h"
34 
35 #ifdef __cplusplus
36 extern "C"
37 {
38 #endif
39 
43 RCL_YAML_PARAM_PARSER_PUBLIC
44 rcl_params_t * rcl_yaml_node_struct_init(
45  const rcutils_allocator_t allocator);
46 
51 RCL_YAML_PARAM_PARSER_PUBLIC
52 rcl_params_t * rcl_yaml_node_struct_init_with_capacity(
53  size_t capacity,
54  const rcutils_allocator_t allocator);
55 
67 RCL_YAML_PARAM_PARSER_PUBLIC
68 rcutils_ret_t rcl_yaml_node_struct_reallocate(
69  rcl_params_t * params_st,
70  size_t new_capacity,
71  const rcutils_allocator_t allocator);
72 
76 RCL_YAML_PARAM_PARSER_PUBLIC
77 rcl_params_t * rcl_yaml_node_struct_copy(
78  const rcl_params_t * params_st);
79 
82 RCL_YAML_PARAM_PARSER_PUBLIC
83 void rcl_yaml_node_struct_fini(
84  rcl_params_t * params_st);
85 
92 RCL_YAML_PARAM_PARSER_PUBLIC
93 bool rcl_parse_yaml_file(
94  const char * file_path,
95  rcl_params_t * params_st);
96 
103 RCL_YAML_PARAM_PARSER_PUBLIC
104 bool rcl_parse_yaml_value(
105  const char * node_name,
106  const char * param_name,
107  const char * yaml_value,
108  rcl_params_t * params_st);
109 
116 RCL_YAML_PARAM_PARSER_PUBLIC
117 rcl_variant_t * rcl_yaml_node_struct_get(
118  const char * node_name,
119  const char * param_name,
120  rcl_params_t * params_st);
121 
124 RCL_YAML_PARAM_PARSER_PUBLIC
125 void rcl_yaml_node_struct_print(
126  const rcl_params_t * const params_st);
127 
128 #ifdef __cplusplus
129 }
130 #endif
131 
132 #endif // RCL_YAML_PARAM_PARSER__PARSER_H_
rcl_params_s
stores all the parameters of all nodes of a process
Definition: types.h:102
rcutils_ret_t
int rcutils_ret_t
rcl_variant_s
variant_t stores the value of a parameter
Definition: types.h:73
rcutils_allocator_t