ROS 2 rclcpp + rcl - rolling  rolling-e7363f10
ROS 2 C++ Client Library with ROS Client Library
validate_topic_name.h
Go to the documentation of this file.
1 // Copyright 2017 Open Source Robotics Foundation, 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 
16 
17 #ifndef RCL__VALIDATE_TOPIC_NAME_H_
18 #define RCL__VALIDATE_TOPIC_NAME_H_
19 
20 #ifdef __cplusplus
21 extern "C"
22 {
23 #endif
24 
25 #include <stddef.h>
26 
27 #include "rcl/macros.h"
28 #include "rcl/types.h"
29 #include "rcl/visibility_control.h"
30 
32 #define RCL_TOPIC_NAME_VALID 0
33 
35 #define RCL_TOPIC_NAME_INVALID_IS_EMPTY_STRING 1
36 
38 #define RCL_TOPIC_NAME_INVALID_ENDS_WITH_FORWARD_SLASH 2
39 
41 #define RCL_TOPIC_NAME_INVALID_CONTAINS_UNALLOWED_CHARACTERS 3
42 
44 #define RCL_TOPIC_NAME_INVALID_NAME_TOKEN_STARTS_WITH_NUMBER 4
45 
47 #define RCL_TOPIC_NAME_INVALID_UNMATCHED_CURLY_BRACE 5
48 
50 #define RCL_TOPIC_NAME_INVALID_MISPLACED_TILDE 6
51 
53 #define RCL_TOPIC_NAME_INVALID_TILDE_NOT_FOLLOWED_BY_FORWARD_SLASH 7
54 
56 #define RCL_TOPIC_NAME_INVALID_SUBSTITUTION_CONTAINS_UNALLOWED_CHARACTERS 8
57 
59 #define RCL_TOPIC_NAME_INVALID_SUBSTITUTION_STARTS_WITH_NUMBER 9
60 
62 
112 RCL_PUBLIC
113 RCL_WARN_UNUSED
114 rcl_ret_t
116  const char * topic_name,
117  int * validation_result,
118  size_t * invalid_index);
119 
121 
133 RCL_PUBLIC
134 RCL_WARN_UNUSED
135 rcl_ret_t
137  const char * topic_name,
138  size_t topic_name_length,
139  int * validation_result,
140  size_t * invalid_index);
141 
143 
148 RCL_PUBLIC
149 RCL_WARN_UNUSED
150 const char *
151 rcl_topic_name_validation_result_string(int validation_result);
152 
153 #ifdef __cplusplus
154 }
155 #endif
156 
157 #endif // RCL__VALIDATE_TOPIC_NAME_H_
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition: types.h:25
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_validate_topic_name(const char *topic_name, int *validation_result, size_t *invalid_index)
Validate a given topic name.
RCL_PUBLIC RCL_WARN_UNUSED rcl_ret_t rcl_validate_topic_name_with_size(const char *topic_name, size_t topic_name_length, int *validation_result, size_t *invalid_index)
Validate a given topic name.
RCL_PUBLIC RCL_WARN_UNUSED const char * rcl_topic_name_validation_result_string(int validation_result)
Return a validation result description, or NULL if unknown or RCL_TOPIC_NAME_VALID.