feat(bindings/cpp): adopt Google C++ Style Guide for API naming#6448
Merged
Xuanwo merged 2 commits intoapache:mainfrom Jul 30, 2025
Merged
feat(bindings/cpp): adopt Google C++ Style Guide for API naming#6448Xuanwo merged 2 commits intoapache:mainfrom
Xuanwo merged 2 commits intoapache:mainfrom
Conversation
- Rename public methods from snake_case to PascalCase - available() -> Available() - read() -> Read() - write() -> Write() - exists() -> Exists() - create_dir() -> CreateDir() - reader() -> GetReader() - lister() -> GetLister() - And all corresponding method implementations - Update documentation and comments to reference new API names - Add Google C++ Style Guide compliance notes to README and CONTRIBUTING - Update all test files and examples to use new API conventions - Preserve standard library virtual function names (underflow, uflow) This change improves code consistency and follows industry standard C++ naming conventions while maintaining full backward compatibility for existing functionality. Signed-off-by: Jack Drogon <[email protected]>
Follow Google C++ Style Guide by removing Get prefix from simple getter functions that directly return member variables: - GetContentLength() -> ContentLength() - GetCacheControl() -> CacheControl() - GetContentDisposition() -> ContentDisposition() - GetContentMd5() -> ContentMd5() - GetContentType() -> ContentType() - GetContentEncoding() -> ContentEncoding() - GetEtag() -> Etag() - GetLastModified() -> LastModified() - GetVersion() -> Version() - GetIsCurrent() -> IsCurrent() - GetIsDeleted() -> IsDeleted() Update all test files and documentation to use the new naming conventions. This change aligns with Google's recommendation that simple accessors should not have Get prefixes. Signed-off-by: Jack Drogon <[email protected]>
Contributor
Author
|
@Xuanwo @deadlinefen need a code review |
Member
|
Is there a way to enforce a coding style? I don't want to worry about this during future reviews. |
Contributor
Author
Use clang-format to format code and use clang-tidy to check code. Something else, we also need reviewer to guarantee. |
Member
Would you like to add them in CI in the following PRs? Other looks good to me. |
Xuanwo
approved these changes
Jul 30, 2025
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.
Adopt Google C++ Style Guide for API naming
This change improves code consistency and follows industry standard
C++ naming conventions while maintaining full backward compatibility
for existing functionality.