mirror of
https://github.com/ksherlock/profuse.git
synced 2025-01-08 09:31:51 +00:00
b4db3e59ab
git-svn-id: https://profuse.googlecode.com/svn/branches/v2@389 aa027e90-d47c-11dd-86d7-074df07e0730
90 lines
1.7 KiB
C++
90 lines
1.7 KiB
C++
#ifndef __PASCAL_ENTRY_H__
|
|
#define __PASCAL_ENTRY_H__
|
|
|
|
#include <Common/smart_pointers.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;
|
|
|
|
|
|
typedef SHARED_PTR(FileEntry) FileEntryPointer;
|
|
typedef SHARED_PTR(VolumeEntry) VolumeEntryPointer;
|
|
|
|
typedef WEAK_PTR(FileEntry) FileEntryWeakPointer;
|
|
typedef WEAK_PTR(VolumeEntry) VolumeEntryWeakPointer;
|
|
|
|
class Entry : public ENABLE_SHARED_FROM_THIS(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; }
|
|
|
|
VolumeEntryWeakPointer 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;
|
|
|
|
VolumeEntryWeakPointer _parent;
|
|
unsigned _address;
|
|
|
|
};
|
|
|
|
|
|
}
|
|
|
|
#endif
|
|
|