2009-11-21 01:45:08 +00:00
|
|
|
#ifndef __UNIVERSALDISKIMAGE_H__
|
|
|
|
#define __UNIVERSALDISKIMAGE_H__
|
|
|
|
|
|
|
|
|
2009-12-16 01:33:28 +00:00
|
|
|
#include <Device/BlockDevice.h>
|
2010-05-18 02:58:26 +00:00
|
|
|
#include <Device/DiskImage.h>
|
|
|
|
|
2009-11-24 04:36:48 +00:00
|
|
|
#include <stdint.h>
|
2009-11-21 01:45:08 +00:00
|
|
|
|
2009-12-16 01:33:28 +00:00
|
|
|
namespace Device {
|
2009-11-21 01:45:08 +00:00
|
|
|
|
|
|
|
class UniversalDiskImage : public DiskImage {
|
|
|
|
public:
|
|
|
|
|
2010-05-18 19:59:18 +00:00
|
|
|
|
|
|
|
|
2011-02-22 04:57:50 +00:00
|
|
|
static BlockDevicePointer Create(const char *name, size_t blocks);
|
|
|
|
static BlockDevicePointer Open(MappedFile *);
|
2009-11-21 01:45:08 +00:00
|
|
|
|
2009-11-23 22:36:05 +00:00
|
|
|
virtual bool readOnly();
|
|
|
|
|
2011-02-22 02:59:33 +00:00
|
|
|
virtual BlockCachePointer createBlockCache();
|
2010-05-18 19:59:18 +00:00
|
|
|
|
2011-03-09 05:02:04 +00:00
|
|
|
|
|
|
|
static bool Validate(MappedFile *, const std::nothrow_t &);
|
|
|
|
static bool Validate(MappedFile *);
|
|
|
|
|
2010-05-18 19:59:18 +00:00
|
|
|
|
2016-08-15 16:29:06 +00:00
|
|
|
UniversalDiskImage(MappedFile *);
|
2009-11-21 01:45:08 +00:00
|
|
|
private:
|
2010-05-18 02:58:26 +00:00
|
|
|
|
2010-05-29 19:29:59 +00:00
|
|
|
UniversalDiskImage();
|
2009-11-23 22:36:05 +00:00
|
|
|
|
2010-05-18 19:59:18 +00:00
|
|
|
uint32_t _format;
|
2009-11-24 04:36:48 +00:00
|
|
|
uint32_t _flags;
|
2010-05-18 19:59:18 +00:00
|
|
|
uint32_t _blocks;
|
|
|
|
uint32_t _dataOffset;
|
|
|
|
uint32_t _dataLength;
|
2009-11-21 01:45:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|