From 34aa68f5af224b5081921195190e94917408204a Mon Sep 17 00:00:00 2001 From: danipiza Date: Fri, 16 Jan 2026 13:12:54 +0100 Subject: [PATCH 1/7] [#24061] Updated read_next_command() for the new FastDDS-Spy filter Signed-off-by: danipiza --- .../user_interface/CommandReader.hpp | 3 ++ .../user_interface/impl/CommandReader.ipp | 36 +++++++++++++++++-- 2 files changed, 37 insertions(+), 2 deletions(-) diff --git a/cpp_utils/include/cpp_utils/user_interface/CommandReader.hpp b/cpp_utils/include/cpp_utils/user_interface/CommandReader.hpp index f73a7aed..b04bf35a 100644 --- a/cpp_utils/include/cpp_utils/user_interface/CommandReader.hpp +++ b/cpp_utils/include/cpp_utils/user_interface/CommandReader.hpp @@ -94,6 +94,9 @@ class CommandReader void read_command_callback_( std::string command_read); + std::vector join_quoted_strings( + const std::vector& input); + //! Builder to transform string into a command enum value. EnumBuilder builder_; diff --git a/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp b/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp index 443ac811..6ed2f514 100644 --- a/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp +++ b/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp @@ -45,13 +45,45 @@ bool CommandReader::read_next_command( std::string full_command = commands_read_.consume(); // Divide command - command.arguments = utils::split_string(full_command, " "); - + command.arguments = join_quoted_strings(utils::split_string(full_command, " ")); // Check if command exists // The args are already set in command, and the enum value will be set string_to_enumeration return builder_.string_to_enumeration(command.arguments[0], command.command); } +template +std::vector CommandReader::join_quoted_strings( + const std::vector& input) +{ + std::vector result; + + for (size_t i = 0; i < input.size(); ++i) + { + // Check if string starts with a quote + if (!input[i].empty() && input[i].front() == '"') + { + std::string joined = input[i]; + + // Keep joining until we find a string ending with a quote + while (i + 1 < input.size() && + (joined.empty() || joined.back() != '"')) + { + joined += " " + input[++i]; + } + + result.push_back(joined.substr(1, joined.size() - 2)); + } + else + { + result.push_back(input[i]); + } + } + + return result; +} + + + template void CommandReader::read_command_callback_( std::string command_read) From efb65cbd69dcc6f0e90da169bd3cd3ccc27c423e Mon Sep 17 00:00:00 2001 From: danipiza Date: Thu, 22 Jan 2026 10:39:56 +0100 Subject: [PATCH 2/7] [#24061] Uncrustify Signed-off-by: danipiza --- .../user_interface/impl/CommandReader.ipp | 124 +++++++++--------- 1 file changed, 62 insertions(+), 62 deletions(-) diff --git a/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp b/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp index 6ed2f514..ba0db4a2 100644 --- a/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp +++ b/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp @@ -17,81 +17,81 @@ #include namespace eprosima { -namespace utils { - -template -CommandReader::CommandReader( - const EnumBuilder& builder, - std::istream& source /* = std::cin */) - : builder_(builder) - , stdin_handler_( - [this](std::string st) + namespace utils { + + template < typename CommandEnum > + CommandReader < CommandEnum > ::CommandReader( + const EnumBuilder < CommandEnum > &builder, + std::istream& source /* = std::cin */) + : builder_(builder) + , stdin_handler_( + [this](std::string st) { this->read_command_callback_(st); }, - true, - 0, - source) - , commands_read_(0, true) -{ - // Do nothing -} - -template -bool CommandReader::read_next_command( - Command& command) -{ - stdin_handler_.read_one_more_line(); - std::string full_command = commands_read_.consume(); - - // Divide command - command.arguments = join_quoted_strings(utils::split_string(full_command, " ")); - // Check if command exists - // The args are already set in command, and the enum value will be set string_to_enumeration - return builder_.string_to_enumeration(command.arguments[0], command.command); -} - -template -std::vector CommandReader::join_quoted_strings( - const std::vector& input) -{ - std::vector result; - - for (size_t i = 0; i < input.size(); ++i) - { - // Check if string starts with a quote - if (!input[i].empty() && input[i].front() == '"') + true, + 0, + source) + , commands_read_(0, true) { - std::string joined = input[i]; + // Do nothing + } + + template < typename CommandEnum > + bool CommandReader < CommandEnum > ::read_next_command( + Command < CommandEnum > &command) + { + stdin_handler_.read_one_more_line(); + std::string full_command = commands_read_.consume(); + + // Divide command + command.arguments = join_quoted_strings(utils::split_string(full_command, " ")); + // Check if command exists + // The args are already set in command, and the enum value will be set string_to_enumeration + return builder_.string_to_enumeration(command.arguments[0], command.command); + } + + template < typename CommandEnum > + std::vector < std::string > CommandReader < CommandEnum > ::join_quoted_strings( + const std::vector < std::string > &input) + { + std::vector < std::string > result; - // Keep joining until we find a string ending with a quote - while (i + 1 < input.size() && - (joined.empty() || joined.back() != '"')) + for (size_t i = 0; i < input.size(); ++i) { - joined += " " + input[++i]; + // Check if string starts with a quote + if (!input[i].empty() && input[i].front() == '"') + { + std::string joined = input[i]; + + // Keep joining until we find a string ending with a quote + while (i + 1 < input.size() && + (joined.empty() || joined.back() != '"')) + { + joined += " " + input[++i]; + } + + result.push_back(joined.substr(1, joined.size() - 2)); + } + else + { + result.push_back(input[i]); + } } - result.push_back(joined.substr(1, joined.size() - 2)); + return result; } - else - { - result.push_back(input[i]); - } - } - - return result; -} -template -void CommandReader::read_command_callback_( - std::string command_read) -{ - commands_read_.produce(command_read); -} + template < typename CommandEnum > + void CommandReader < CommandEnum > ::read_command_callback_( + std::string command_read) + { + commands_read_.produce(command_read); + } -} /* namespace utils */ + } /* namespace utils */ } /* namespace eprosima */ // Include implementation template file From 56c6e4ca5c5b3cf4d22b7ba3e7ea5279ba48dc15 Mon Sep 17 00:00:00 2001 From: danipiza Date: Fri, 23 Jan 2026 13:08:26 +0100 Subject: [PATCH 3/7] [#24061] New uncrustify Signed-off-by: danipiza --- .../user_interface/CommandReader.hpp | 6 +- .../user_interface/impl/CommandReader.ipp | 124 +++++++++--------- 2 files changed, 64 insertions(+), 66 deletions(-) diff --git a/cpp_utils/include/cpp_utils/user_interface/CommandReader.hpp b/cpp_utils/include/cpp_utils/user_interface/CommandReader.hpp index b04bf35a..1544c94f 100644 --- a/cpp_utils/include/cpp_utils/user_interface/CommandReader.hpp +++ b/cpp_utils/include/cpp_utils/user_interface/CommandReader.hpp @@ -26,7 +26,7 @@ namespace utils { * * @tparam CommandEnum enumeration that represent the different commands available. */ -template +template struct Command { //! Command in the way of a enumeration class. @@ -48,7 +48,7 @@ struct Command * * @note This class relies on \c StdinEventHandler to read from stdin and in \c EnumBuilder to interpret command. */ -template +template class CommandReader { public: @@ -121,7 +121,7 @@ class CommandReader }; -} /* namespace utils */ +} /* namespace utils */ } /* namespace eprosima */ // Include implementation template file diff --git a/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp b/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp index ba0db4a2..b2e42343 100644 --- a/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp +++ b/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp @@ -17,81 +17,79 @@ #include namespace eprosima { - namespace utils { - - template < typename CommandEnum > - CommandReader < CommandEnum > ::CommandReader( - const EnumBuilder < CommandEnum > &builder, - std::istream& source /* = std::cin */) - : builder_(builder) - , stdin_handler_( - [this](std::string st) +namespace utils { + +template +CommandReader::CommandReader( + const EnumBuilder& builder, + std::istream& source /* = std::cin */) + : builder_(builder) + , stdin_handler_( + [this](std::string st) { this->read_command_callback_(st); }, - true, - 0, - source) - , commands_read_(0, true) - { - // Do nothing - } - - template < typename CommandEnum > - bool CommandReader < CommandEnum > ::read_next_command( - Command < CommandEnum > &command) - { - stdin_handler_.read_one_more_line(); - std::string full_command = commands_read_.consume(); - - // Divide command - command.arguments = join_quoted_strings(utils::split_string(full_command, " ")); - // Check if command exists - // The args are already set in command, and the enum value will be set string_to_enumeration - return builder_.string_to_enumeration(command.arguments[0], command.command); - } - - template < typename CommandEnum > - std::vector < std::string > CommandReader < CommandEnum > ::join_quoted_strings( - const std::vector < std::string > &input) + true, + 0, + source) + , commands_read_(0, true) +{ + // Do nothing +} + +template +bool CommandReader::read_next_command( + Command& command) +{ + stdin_handler_.read_one_more_line(); + std::string full_command = commands_read_.consume(); + + // Divide command + command.arguments = join_quoted_strings(utils::split_string(full_command, " ")); + // Check if command exists + // The args are already set in command, and the enum value will be set string_to_enumeration + return builder_.string_to_enumeration(command.arguments[0], command.command); +} + +template +std::vector CommandReader::join_quoted_strings( + const std::vector& input) +{ + std::vector result; + + for (size_t i = 0; i < input.size(); ++i) + { + // Check if string starts with a quote + if (!input[i].empty() && input[i].front() == '"') { - std::vector < std::string > result; + std::string joined = input[i]; - for (size_t i = 0; i < input.size(); ++i) + // Keep joining until we find a string ending with a quote + while (i + 1 < input.size() && + (joined.empty() || joined.back() != '"')) { - // Check if string starts with a quote - if (!input[i].empty() && input[i].front() == '"') - { - std::string joined = input[i]; - - // Keep joining until we find a string ending with a quote - while (i + 1 < input.size() && - (joined.empty() || joined.back() != '"')) - { - joined += " " + input[++i]; - } - - result.push_back(joined.substr(1, joined.size() - 2)); - } - else - { - result.push_back(input[i]); - } + joined += " " + input[++i]; } - return result; + result.push_back(joined.substr(1, joined.size() - 2)); } - - - - template < typename CommandEnum > - void CommandReader < CommandEnum > ::read_command_callback_( - std::string command_read) + else { - commands_read_.produce(command_read); + result.push_back(input[i]); } + } + + return result; +} + +template +void CommandReader::read_command_callback_( + std::string command_read) +{ + commands_read_.produce(command_read); +} - } /* namespace utils */ +} /* namespace utils */ } /* namespace eprosima */ // Include implementation template file From 15a18b3baae84276c6c3cfbec654d4eb8a8cae6e Mon Sep 17 00:00:00 2001 From: danipiza Date: Wed, 28 Jan 2026 15:02:52 +0100 Subject: [PATCH 4/7] [#24061] Changed eProsima-CI tag for test Signed-off-by: danipiza --- .github/actions/project_dependencies/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/project_dependencies/action.yml b/.github/actions/project_dependencies/action.yml index 9441aead..49deeda0 100644 --- a/.github/actions/project_dependencies/action.yml +++ b/.github/actions/project_dependencies/action.yml @@ -41,18 +41,18 @@ runs: steps: - name: Install Fast DDS dependencies - uses: eProsima/eProsima-CI/multiplatform/install_fastdds_dependencies@v0 + uses: eProsima/eProsima-CI/multiplatform/install_fastdds_dependencies@main with: cmake_build_type: ${{ inputs.cmake_build_type }} - name: Install yaml cpp dependency - uses: eProsima/eProsima-CI/multiplatform/install_yamlcpp@v0 + uses: eProsima/eProsima-CI/multiplatform/install_yamlcpp@main with: cmake_build_type: ${{ inputs.cmake_build_type }} # Fast DDS artifact - name: Download dependencies artifact - uses: eProsima/eProsima-CI/multiplatform/download_dependency@v0 + uses: eProsima/eProsima-CI/multiplatform/download_dependency@main with: artifact_name: build_fastdds_${{ inputs.custom_version_build }}_${{ inputs.os }}_${{ inputs.cmake_build_type }}${{ inputs.dependencies_artifact_postfix }} workflow_source: build_fastdds.yml From ab57c6c0de9a0f7abd7e92b6f0fdf31d26cf8d43 Mon Sep 17 00:00:00 2001 From: danipiza Date: Fri, 30 Jan 2026 08:48:40 +0100 Subject: [PATCH 5/7] [#24061] Reverted eProsima-CI tags to realease Signed-off-by: danipiza --- .github/actions/project_dependencies/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/actions/project_dependencies/action.yml b/.github/actions/project_dependencies/action.yml index 49deeda0..9441aead 100644 --- a/.github/actions/project_dependencies/action.yml +++ b/.github/actions/project_dependencies/action.yml @@ -41,18 +41,18 @@ runs: steps: - name: Install Fast DDS dependencies - uses: eProsima/eProsima-CI/multiplatform/install_fastdds_dependencies@main + uses: eProsima/eProsima-CI/multiplatform/install_fastdds_dependencies@v0 with: cmake_build_type: ${{ inputs.cmake_build_type }} - name: Install yaml cpp dependency - uses: eProsima/eProsima-CI/multiplatform/install_yamlcpp@main + uses: eProsima/eProsima-CI/multiplatform/install_yamlcpp@v0 with: cmake_build_type: ${{ inputs.cmake_build_type }} # Fast DDS artifact - name: Download dependencies artifact - uses: eProsima/eProsima-CI/multiplatform/download_dependency@main + uses: eProsima/eProsima-CI/multiplatform/download_dependency@v0 with: artifact_name: build_fastdds_${{ inputs.custom_version_build }}_${{ inputs.os }}_${{ inputs.cmake_build_type }}${{ inputs.dependencies_artifact_postfix }} workflow_source: build_fastdds.yml From b5fe27e9d29f947c7395f9cab41a42efbf817333 Mon Sep 17 00:00:00 2001 From: danipiza Date: Fri, 30 Jan 2026 12:06:01 +0100 Subject: [PATCH 6/7] [#24061] Covered case when the filter does not contain a closing quote Signed-off-by: danipiza --- .../cpp_utils/user_interface/impl/CommandReader.ipp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp b/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp index b2e42343..5d8025fe 100644 --- a/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp +++ b/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp @@ -71,7 +71,12 @@ std::vector CommandReader::join_quoted_strings( joined += " " + input[++i]; } - result.push_back(joined.substr(1, joined.size() - 2)); + // Check if the last character in the joined string is + // a closed quote (") or not. If it is a closed quote + // remove it from the string (value = 2) + // otherwise keep all the string (value = 1) + int tmp = joined[joined.size() - 1] == '"' ? 2 : 1; + result.push_back(joined.substr(1, joined.size() - tmp)); } else { @@ -89,7 +94,7 @@ void CommandReader::read_command_callback_( commands_read_.produce(command_read); } -} /* namespace utils */ +} /* namespace utils */ } /* namespace eprosima */ // Include implementation template file From 4c8703958ff6bfa8cf804cbedc72ca43303a81e1 Mon Sep 17 00:00:00 2001 From: danipiza Date: Fri, 30 Jan 2026 12:11:33 +0100 Subject: [PATCH 7/7] [#24061] Applied revision Signed-off-by: danipiza --- .../include/cpp_utils/user_interface/CommandReader.hpp | 2 +- .../include/cpp_utils/user_interface/impl/CommandReader.ipp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cpp_utils/include/cpp_utils/user_interface/CommandReader.hpp b/cpp_utils/include/cpp_utils/user_interface/CommandReader.hpp index 1544c94f..59c08e0f 100644 --- a/cpp_utils/include/cpp_utils/user_interface/CommandReader.hpp +++ b/cpp_utils/include/cpp_utils/user_interface/CommandReader.hpp @@ -121,7 +121,7 @@ class CommandReader }; -} /* namespace utils */ +} /* namespace utils */ } /* namespace eprosima */ // Include implementation template file diff --git a/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp b/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp index 5d8025fe..3260a5d3 100644 --- a/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp +++ b/cpp_utils/include/cpp_utils/user_interface/impl/CommandReader.ipp @@ -72,9 +72,9 @@ std::vector CommandReader::join_quoted_strings( } // Check if the last character in the joined string is - // a closed quote (") or not. If it is a closed quote - // remove it from the string (value = 2) - // otherwise keep all the string (value = 1) + // a closing quote (") or not. If it is a closing quote + // remove it from the string (value = 2) + // otherwise keep all the string (value = 1) int tmp = joined[joined.size() - 1] == '"' ? 2 : 1; result.push_back(joined.substr(1, joined.size() - tmp)); }