basically what it will do is allow you to open up a file and use it as a disk image. Then you can read and write sectors and such to it..good for making prototype filesystem stuff..
I am having a problem determining how the constructor should be set up..
if I have something like "Disk(unsigned int size,string& filename)" then what do I do if filename doesn't exist? or if I can't create it?
but if I wait until a "open_disk(string& filename)" then it's not initialized until you call that...
what should I do!?
also, anyone see anything wrong with this basic class I made?
Code: Select all
class Disk{
disk_geometry dg;
public:
//constructors..
virtual ~Disk();
Disk(disk_geometry *geo,string& filename);
Disk(unsigned int c,unsigned int h,unsigned int s,const string& filename);
Disk(const Disk& source);
//Interface:
virtual unsigned long long DiskSize(){
return dg.bps*dg.spt*dg.cph*dg.hpd;
}
virtual char *ReadSector(unsigned int abs_sector); //?
};