rcl  master
C API providing common ROS client library functionality.
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 "rcl/macros.h"
26 #include "rcl/types.h"
27 #include "rcl/visibility_control.h"
28 
30 #define RCL_TOPIC_NAME_VALID 0
31 
33 #define RCL_TOPIC_NAME_INVALID_IS_EMPTY_STRING 1
34 
36 #define RCL_TOPIC_NAME_INVALID_ENDS_WITH_FORWARD_SLASH 2
37 
39 #define RCL_TOPIC_NAME_INVALID_CONTAINS_UNALLOWED_CHARACTERS 3
40 
42 #define RCL_TOPIC_NAME_INVALID_NAME_TOKEN_STARTS_WITH_NUMBER 4
43 
45 #define RCL_TOPIC_NAME_INVALID_UNMATCHED_CURLY_BRACE 5
46 
48 #define RCL_TOPIC_NAME_INVALID_MISPLACED_TILDE 6
49 
51 #define RCL_TOPIC_NAME_INVALID_TILDE_NOT_FOLLOWED_BY_FORWARD_SLASH 7
52 
54 #define RCL_TOPIC_NAME_INVALID_SUBSTITUTION_CONTAINS_UNALLOWED_CHARACTERS 8
55 
57 #define RCL_TOPIC_NAME_INVALID_SUBSTITUTION_STARTS_WITH_NUMBER 9
58 
60 
110 RCL_PUBLIC
111 RCL_WARN_UNUSED
112 rcl_ret_t
114  const char * topic_name,
115  int * validation_result,
116  size_t * invalid_index);
117 
119 
131 RCL_PUBLIC
132 RCL_WARN_UNUSED
133 rcl_ret_t
135  const char * topic_name,
136  size_t topic_name_length,
137  int * validation_result,
138  size_t * invalid_index);
139 
141 
146 RCL_PUBLIC
147 RCL_WARN_UNUSED
148 const char *
149 rcl_topic_name_validation_result_string(int validation_result);
150 
151 #ifdef __cplusplus
152 }
153 #endif
154 
155 #endif // RCL__VALIDATE_TOPIC_NAME_H_
types.h
rcl_ret_t
rmw_ret_t rcl_ret_t
The type that holds an rcl return code.
Definition: types.h:23
rcl_validate_topic_name_with_size
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_validate_topic_name
rcl_ret_t rcl_validate_topic_name(const char *topic_name, int *validation_result, size_t *invalid_index)
Validate a given topic name.
rcl_topic_name_validation_result_string
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.