Conversation
|
Sorry for the delay @MeAreJeenius .. so heavy weight PRs moving through the pipes :-) If you can look into the 'Checks' tab above: https://github.com/dosbox-staging/dosbox-staging/pull/2618/checks MacOS and Linux show a warning - which I think it causing link problems on Windows. Once that fixed it, CI should go green. The refactoring and new tests look great! Will get the review underway soon. |
|
@kcgen |
Edit: looks like force-pushes are OK. Snipped out the noise to make way for PR-related signal :-) |
d0232f2 to
110c882
Compare
df74de6 to
b4122b1
Compare
These functions were never used by the Program base class
b4122b1 to
d7c150d
Compare
|
Just checked the CI results (see the 'checks' tab above).
|
|
All commits are building; bisect is healthy 👍 |
b11d4cf to
02cc16c
Compare
The FileReader class is a simple helper class that reads the contents of a file and uses RAII to handle its resources. This class interface implements the ByteReader interface, which allows for non-file implentations to be substituted through polymorphism instead of having dependencies on the concrete file reader. This is especially useful for tests.
Abstracts away file management in BatchFile. Prevents a crash when attempting to read a file without the necessary permissions.
Change the constructor to take string views instead of const char* Shorten constructor body
CommandLine doesn't currently need to be used through polymorphism, so this avoids an allocation.
Allows classes which implement this to read value from an environment without the hard requirement of a DOS_Shell. Most useful for testing.
Previously, a BatchFile would store its parent Batchfile, which would then set to the DOS_Shell's BatchFile pointer upon destruction. Replacing this system with a stack of BatchFiles makes this behaviour more intuitive and easier to follow without changing the functionality.
RunInternal() and the BatchFile branch of the main loop mostly overlapped, so they have been consolidated.
Previously, BatchFiles contained their parent's echo value, which would then be applied to the shell upon destruction. Having the BatchFile contain its own echo value makes it easier to read and reason about.
Instead of having a hard dependency on DOS_Shell, BatchFiles can use any class that can query an environment variable. This makes the BatchFile class easier to test.
02cc16c to
d401845
Compare
|
@kcgen |
Because MSVC is overzealous in warning about using "unsafe" (but standard) c-string functions in favor of their own decidedly non-standard |
There shouldn't be any functional changes except for a fix for a crash when attempting to read a batch file without read permissions on that file.