-
Notifications
You must be signed in to change notification settings - Fork 765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add std::string::compare API to fixed_string [15351] #2901
Conversation
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
@@ -170,6 +170,13 @@ struct fixed_string | |||
return string_len; | |||
} | |||
|
|||
/*! | |||
* Compare with a std:.string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Little typo: std::string instead of std:.string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in a4d80e5
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A test should be added to test/unittest/utils/FixedSizeStringTests.cpp
It would also be nice to have overloads for the compare method, similar to what we have for operator ==
:
int compare(
const char* s) const;
template<size_t N> int compare(
const fixed_string<N>& str) const;
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
Signed-off-by: Ricardo González Moreno <ricardo@richiware.dev>
@richiprosima Please test this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Failed tests not related. |
Description
Updating generated code from IDL files with last fastddsgen version breaks the compilation of several tests because
fixed_string
doesn't implementstd::string::compare
. This PR implements this function.Contributor Checklist
versions.md
file (if applicable).Reviewer Checklist