Skip to content

Minor cleanup of FileSaver#8863

Open
jtdavis777 wants to merge 8 commits intogoogle:masterfrom
jtdavis777:feature/cleanup_file_saver_impl
Open

Minor cleanup of FileSaver#8863
jtdavis777 wants to merge 8 commits intogoogle:masterfrom
jtdavis777:feature/cleanup_file_saver_impl

Conversation

@jtdavis777
Copy link
Collaborator

@jtdavis777 jtdavis777 commented Dec 18, 2025

After discussion with @dbaileychess, I have moved the concrete instance definitions of FileSaver into the cpp files which define them.

Fixes #8902 as well

@github-actions github-actions bot added c++ codegen Involving generating code from schema labels Dec 18, 2025
@jtdavis777 jtdavis777 added the ready-for-merge This PR has been approved by a maintainer and is ready for merge by a code owner label Dec 20, 2025
private:
std::set<std::string> file_names_{};
};
std::unique_ptr<FileSaver> CreateFileSaver();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These kind of helper functions don't seem necessary to me.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok I guess they're needed because of the inheritance.
In that case this is all boilerplate, and I don't have a lot of opinions on what is the nicest boilerplate. I would pick whatever the simplest code is :)

bool binary) final {
std::ofstream ofs{name,
binary ? std::ofstream::binary : std::ofstream::out};

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove all these empty lines here and elsewhere, this is not in the style of the rest of the codebase and the google styleguide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ codegen Involving generating code from schema ready-for-merge This PR has been approved by a maintainer and is ready for merge by a code owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NULL pointer dereference in GenerateBinary

2 participants