Skip to content

Conversation

@benhillis
Copy link
Member

This helper class has always been a bit of a mess, this change reimplements the class using RAII classes and reduces complexity and code length.

Copilot AI review requested due to automatic review settings December 6, 2025 01:01
@benhillis benhillis requested a review from a team as a code owner December 6, 2025 01:01
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the SvcCommIo helper class to use RAII patterns, significantly simplifying the code and improving maintainability. The changes replace a monolithic implementation with well-structured RAII wrapper classes (ConsoleInput and ConsoleOutput) that automatically manage console state restoration.

Key changes:

  • Introduced ConsoleInput and ConsoleOutput RAII wrapper classes with factory methods
  • Eliminated manual cleanup code by leveraging RAII destructors
  • Reduced code length and complexity through better separation of concerns

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/windows/common/svccommio.hpp Adds ConsoleInput and ConsoleOutput RAII wrapper class declarations; updates SvcCommIo to use these wrappers instead of manual state tracking
src/windows/common/svccommio.cpp Implements RAII wrappers with factory methods; refactors SvcCommIo constructor to use the new wrappers; removes manual cleanup code replaced by RAII destructors

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants