-
Notifications
You must be signed in to change notification settings - Fork 3
Add query parameter support to timeplus-cpp protocol #25
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 query parameter support to timeplus-cpp protocol #25
Conversation
timeplus/base/wire_format.cpp
Outdated
| inline const char* find_quoted_chars(const char* start, const char* end) | ||
| { | ||
| static constexpr char quoted_chars[] = {'\0', '\b', '\t', '\n', '\'', '\\'}; | ||
| const auto first = std::find_first_of(start, end, std::begin(quoted_chars), std::end(quoted_chars)); |
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.
nit : const auto * first =
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.
std::find_first_of returns a const char* here, so const auto first = … already deduces the pointer type. I can switch to const char* first if you prefer explicitness, happy to update.
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.
yes please, this is usually we do to make things explicit and easier to read
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.
| return (first == end) ? nullptr : first; | ||
| } | ||
|
|
||
| void WireFormat::WriteQuotedString(OutputStream& output, std::string_view value) { |
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.
If we could have some unit test to cover this function, it will be awesome
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.
Implementation:
Notes/Risks: