You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I have merged but this has some issues. What if the string or string view is shorter than the array? The Java codec deals with this by zero padding the remainder and doing a min on the copy for length of view and length of array.
@mjpt777 yes, I understand that. I would, though, say that to avoid noise and the fact that there is very little reason to use it yet that there is no compelling reason to do it at this time.
It probably should be encoding specific what to pad with. And it should be compatible with what Java does right now.
The getter is always going to be a specific length. It just may have encoding specific nulls, etc. The setter is the one to determine what to do with the string/string_view is too short.
Nice. We can fix cpp generator for string/string_view. What about const char* setter? Calculate string length (strnlen)? Add the second parametr length? template<size_t N> putField(char const (&value)[N]) ?
checks for const char * versions are not needed. Those are the sharp knives. Know how to use them. std:string and std::string_view are for those who need their hands held while they cross the street.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added std::string_view getter/setter for string-like fields
Added non-const raw access for array like fields