2011-02-19 18:06:42 +00:00
|
|
|
#ifndef __UNIVERSALDISKIMAGE_H__
|
|
|
|
#define __UNIVERSALDISKIMAGE_H__
|
|
|
|
|
|
|
|
|
|
|
|
#include <Device/BlockDevice.h>
|
|
|
|
#include <Device/DiskImage.h>
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
|
|
|
namespace Device {
|
|
|
|
|
|
|
|
class UniversalDiskImage : public DiskImage {
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
|
|
|
2011-02-28 05:04:30 +00:00
|
|
|
static BlockDevicePointer Create(const char *name, size_t blocks);
|
|
|
|
static BlockDevicePointer Open(MappedFile *);
|
2011-02-19 18:06:42 +00:00
|
|
|
|
|
|
|
virtual bool readOnly();
|
|
|
|
|
2011-02-21 22:47:56 +00:00
|
|
|
virtual BlockCachePointer createBlockCache();
|
2011-02-19 18:06:42 +00:00
|
|
|
|
2011-03-07 23:39:52 +00:00
|
|
|
|
|
|
|
static bool Validate(MappedFile *, const std::nothrow_t &);
|
|
|
|
static bool Validate(MappedFile *);
|
|
|
|
|
2011-02-19 18:06:42 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
UniversalDiskImage();
|
|
|
|
|
|
|
|
UniversalDiskImage(MappedFile *);
|
|
|
|
|
|
|
|
uint32_t _format;
|
|
|
|
uint32_t _flags;
|
|
|
|
uint32_t _blocks;
|
|
|
|
uint32_t _dataOffset;
|
|
|
|
uint32_t _dataLength;
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|