From f8ddc09a70d4a867ab02b3ee8e9e1ffa8796a7c7 Mon Sep 17 00:00:00 2001 From: ksherlock Date: Mon, 23 Nov 2009 03:19:38 +0000 Subject: [PATCH] git-svn-id: https://profuse.googlecode.com/svn/branches/v2@97 aa027e90-d47c-11dd-86d7-074df07e0730 --- BlockDevice.h | 2 ++ Buffer.cpp | 16 ++++++++++++++++ Buffer.h | 4 ++++ Directory.h | 8 ++++++++ 4 files changed, 30 insertions(+) diff --git a/BlockDevice.h b/BlockDevice.h index 4a7ae92..b35d899 100644 --- a/BlockDevice.h +++ b/BlockDevice.h @@ -20,6 +20,8 @@ public: virtual bool readOnly() = 0; virtual void sync() = 0; + virtual unsigned blocks(); + void zeroBlock(unsigned block); }; diff --git a/Buffer.cpp b/Buffer.cpp index 9e855ad..563d9ef 100644 --- a/Buffer.cpp +++ b/Buffer.cpp @@ -15,6 +15,22 @@ void Buffer::push16le(uint16_t x) _buffer.push_back((x >> 8) & 0xff); } + +void Buffer::push24be(uint32_t x) +{ + _buffer.push_back((x >> 16) & 0xff); + _buffer.push_back((x >> 8) & 0xff); + _buffer.push_back(x & 0xff); +} + +void Buffer::push24le(uint32_t x) +{ + _buffer.push_back(x & 0xff); + _buffer.push_back((x >> 8) & 0xff); + _buffer.push_back((x >> 16) & 0xff); +} + + void Buffer::push32be(uint32_t x) { _buffer.push_back((x >> 24) & 0xff); diff --git a/Buffer.h b/Buffer.h index 4436862..8f98641 100644 --- a/Buffer.h +++ b/Buffer.h @@ -21,6 +21,10 @@ public: void push16be(uint16_t); void push16le(uint16_t); + + void push24be(uint32_t); + void push24le(uint32_t); + void push32be(uint32_t); void push32le(uint32_t); diff --git a/Directory.h b/Directory.h index 7b8be06..c546d68 100644 --- a/Directory.h +++ b/Directory.h @@ -25,6 +25,7 @@ enum Access { }; enum StorageType { + DeletedFile = 0x00, SeedlingFile = 0x01, SaplingFile = 0x02, TreeFile = 0x03, @@ -166,6 +167,13 @@ private: class FileEntry : public Entry { public: + unsigned fileType() const { return _fileType; } + unsigned auxType() const { return _auxType; } + unsigned blocksUsed() const { return _blocksUsed; } + unsigned eof() const { return _eof; } + + DateTime creation() const { return _creation; } + DateTime modification() const { return _modification; } private: unsigned _fileType;