diff options
Diffstat (limited to 'src/dev')
-rw-r--r-- | src/dev/disk_image.hh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/dev/disk_image.hh b/src/dev/disk_image.hh index 905879248..da96082cb 100644 --- a/src/dev/disk_image.hh +++ b/src/dev/disk_image.hh @@ -137,4 +137,20 @@ class CowDiskImage : public DiskImage virtual std::streampos write(const uint8_t *data, std::streampos offset); }; +void SafeRead(std::ifstream &stream, void *data, int count); + +template<class T> +void SafeRead(std::ifstream &stream, T &data); + +template<class T> +void SafeReadSwap(std::ifstream &stream, T &data); + +void SafeWrite(std::ofstream &stream, const void *data, int count); + +template<class T> +void SafeWrite(std::ofstream &stream, const T &data); + +template<class T> +void SafeWriteSwap(std::ofstream &stream, const T &data); + #endif // __DISK_IMAGE_HH__ |