mirror of
https://github.com/ksherlock/profuse.git
synced 2025-01-10 07:30:09 +00:00
776475f33e
git-svn-id: https://profuse.googlecode.com/svn/branches/v2@282 aa027e90-d47c-11dd-86d7-074df07e0730
83 lines
1.4 KiB
C++
83 lines
1.4 KiB
C++
#ifndef __PASCAL_ENTRY_H__
|
|
#define __PASCAL_ENTRY_H__
|
|
|
|
#include <Pascal/Date.h>
|
|
|
|
|
|
namespace Device {
|
|
class BlockDevice;
|
|
class BlockCache;
|
|
}
|
|
|
|
namespace LittleEndian {
|
|
class IOBuffer;
|
|
}
|
|
|
|
namespace Pascal {
|
|
|
|
|
|
enum {
|
|
kUntypedFile,
|
|
kBadBlockFile,
|
|
kCodeFile,
|
|
kTextFile,
|
|
kInfoFile,
|
|
kDataFile,
|
|
kGrafFile,
|
|
kFotoFile,
|
|
kSecureDir
|
|
};
|
|
|
|
class FileEntry;
|
|
class VolumeEntry;
|
|
|
|
class Entry {
|
|
|
|
public:
|
|
|
|
virtual ~Entry();
|
|
|
|
unsigned blocks() const { return _lastBlock - _firstBlock; }
|
|
|
|
unsigned firstBlock() const { return _firstBlock; }
|
|
unsigned lastBlock() const { return _lastBlock; }
|
|
|
|
unsigned fileKind() const { return _fileKind; }
|
|
|
|
unsigned inode() const { return _inode; }
|
|
void setInode(unsigned inode) { _inode = inode; }
|
|
|
|
VolumeEntry *parent() { return _parent; }
|
|
|
|
|
|
protected:
|
|
|
|
static unsigned ValidName(const char *name, unsigned maxSize);
|
|
|
|
virtual void writeDirectoryEntry(LittleEndian::IOBuffer *);
|
|
|
|
Entry();
|
|
Entry(void *);
|
|
void init(void *);
|
|
|
|
unsigned _firstBlock;
|
|
unsigned _lastBlock;
|
|
unsigned _fileKind;
|
|
|
|
unsigned _inode;
|
|
|
|
private:
|
|
|
|
friend class VolumeEntry;
|
|
|
|
VolumeEntry *_parent;
|
|
unsigned _address;
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|