Repository navigation
docs(cpp): clarify Encode separator and padding - #769
Open
vinsymoyya wants to merge 1 commit into
Open
vinsymoyya wants to merge 1 commit into
vinsymoyya wants to merge 1 commit into
Conversation
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The C++
Encodecomment says its separator is optional, which conflicts with the specification and the returned full codes. It also leaves the string length ambiguous when fewer than eight significant digits are requested: a two-digit code such as8F000000+has nine characters, rather than three.Document the required
+separator after eight characters, zero padding, and the existing normalization of requested significant-digit counts. This changes only the public API comment.Validation: a native C++ contract harness checked all ten valid lengths (2, 4, 6, 8, 10 through 15), padding, separator position, and the distinct
Shortenresult. It also checked requested lengths 0, 1, 3, 5, 7, 9, and 16 against their normalized lengths. The existing C++ suite passed 1,074 tests under MSVC (excluding the benchmark);clang-format --dry-run --Werror cpp/openlocationcode.handgit diff --checkpassed. The Bazel/multilanguage matrix was not run locally.Fixes #443.