Skip to content
Snippets Groups Projects
Commit 78df8c61 authored by Fernando Herrero's avatar Fernando Herrero
Browse files

Fix tf2 listener constructor comma check

parent 36bc575b
No related branches found
No related tags found
No related merge requests found
......@@ -144,14 +144,36 @@ function create_tf2_listener
# modify Node.cpp #
#Add constructor
if [[ "${driver_alg}" = "driver" ]]
line="${listener_name}(tf2_buffer)"
#check if ':' are needed
comment="${class_name}::${class_name}("
add_char=`grep "${comment}" "${node_c}" | grep " :"`
if [[ -z ${add_char} ]]
then
comment="iri_base_driver::IriBaseNodeDriver<"
sed -i "/${comment}/s|$| :|" "${node_c}"
add_line_to_file "\ \ ${line}" "${comment}" "${node_c}"
else
comment="algorithm_base::IriBaseAlgorithm<"
#check if it is an algorithm or a driver
if [[ ${driver_alg} == "alg" ]]
then
comment="::IriBaseAlgorithm<"
else
comment="::IriBaseNodeDriver<"
fi
#check if ',' is needed
add_char=`grep "${comment}" "${node_c}" | grep ","`
if [[ -z ${add_char} ]]
then
#add ',' to comment
sed -i "/${comment}/s|$|,|" "${node_c}"
add_line_to_file "\ \ ${line}" "${comment}" "${node_c}"
else
add_line_to_file "\ \ ${line}," "${comment}" "${node_c}"
fi
fi
line=",${listener_name}(tf2_buffer)"
add_line_to_file " ${line}" "${comment}" "${node_c}"
#Add example
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment