Main Page Compound List File List Compound Members File Members
filehdr.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "copyright.h"
00013
00014 #ifndef FILEHDR_H
00015 #define FILEHDR_H
00016
00017 #include "disk.h"
00018 #include "bitmap.h"
00019
00020 #define NumDirect ((SectorSize - 2 * sizeof(int)) / sizeof(int))
00021 #define MaxFileSize (NumDirect * SectorSize)
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 class FileHeader {
00039 public:
00040 bool Allocate(BitMap *bitMap, int fileSize);
00041
00042
00043 void Deallocate(BitMap *bitMap);
00044
00045
00046 void FetchFrom(int sectorNumber);
00047 void WriteBack(int sectorNumber);
00048
00049
00050 int ByteToSector(int offset);
00051
00052
00053
00054 int FileLength();
00055
00056
00057 void Print();
00058
00059 private:
00060 int numBytes;
00061 int numSectors;
00062 int dataSectors[NumDirect];
00063
00064 };
00065
00066 #endif // FILEHDR_H
Generated on Mon Feb 10 09:54:45 2003 for nachos by
1.2.14 written by Dimitri van Heesch,
© 1997-2002
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees