Judging by the usage, this header belongs in there instead of being
limited to dos module only. This change makes it easier to reuse code
for new features related to drives mounting/unmounting.
The single use from friended class is in public interface. Removal of
friend designators allows Clang to pinpoint few additional unused
private fields.
Also, replacing unique_ptr with shared_ptr makes it unnecessary to move
a pointer when swapping boot disks; moving shared_ptr would lead to
inconsistent internal state.
Fixes: #94
- Move imageDiskList from pointer to vector of unique_ptr
- Replace string operations with size-limited versions
- Initialize members
- Eliminate unecessary casts
- Eliminate memory-leak on pointer assignment
- Fix Bitu printf format type
- Check a pointer prior to dereferencing it
- Prevent writing one-beyond the last index
- Replace strcpy with with helper safe_strcpy, provided by @dreamer - thank you!
- Replace strcat with strncat
- Add constructor intializers for scalars and arrays
- Initialize and replace 0-value pointers with nullptr
- Pass in the buffer length when strncpy'ing into a function variable
Should fix that directories with the same length as a deleted directory had some small issues.
Also blocks the creation of files in directories marked as deleted.
Small speed up to MakeDir, so it doesn't rely on mkdir when a directory is created inside a deleted directory.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4268
When active, this drive redirects new and changed files to a different location.
The files in the overlay and normal drive are merged on startup and kept up to date when the game changes something.
Files in the overlay are priotizedi, if they exists, above the normal files.
The drive will switch to an overlayed version of the file on the first write! (Not when opening the file in write-mode).
The overlay is capable of creating missing directories.
With the help of DBOVERLAY files, the drive keeps track of files that are present in the normal directory but deleted by the game.
All changes are preserved between sessions.
Current design principles/limitations/requirements:
1) All directories that can be used for saving, must exist already in the base before mounting. (they will be created by DOSBox if missing in the overlay)
2) All filenames inside the overlay directories are UPPERCASE and conform to the 8.3 standard except for the special DBOVERLAY files.
3) To keep point 1 valid at all times, support for creating/renaming/removing directories has been disabled.
Thanks for the help GOG.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4196
Added support for volume label searching on Virtual Drives.
Added warnings for volume searching on Drive Fat.
Improved support for Filelabel searching on drive_local to include fcbfinds
Added Drivelabel "DOSBOX" to Virtual Drives.
Changed default Label for localdrives to "NO_LABEL".
Made DOS_FindFirst fcb finds aware.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1770