| 96 | }; |
| 97 | |
| 98 | class MemoryBlock : public Block |
| 99 | { |
| 100 | public: |
| 101 | MemoryBlock(UCHAR* memory, Block* tail, size_t length) |
| 102 | : Block(tail, length), ptr(memory) |
| 103 | {} |
| 104 | |
| 105 | ~MemoryBlock() |
| 106 | { |
| 107 | delete[] ptr; |
| 108 | } |
| 109 | |
| 110 | FB_SIZE_T read(offset_t offset, void* buffer, FB_SIZE_T length); |
| 111 | FB_SIZE_T write(offset_t offset, const void* buffer, FB_SIZE_T length); |
| 112 | |
| 113 | UCHAR* inMemory(offset_t offset, size_t _size) const |
| 114 | { |
| 115 | if ((offset < this->size) && (offset + _size <= this->size)) |
| 116 | return ptr + offset; |
| 117 | |
| 118 | return NULL; |
| 119 | } |
| 120 | |
| 121 | bool sameFile(const Firebird::TempFile*) const |
| 122 | { |
| 123 | return false; |
| 124 | } |
| 125 | |
| 126 | protected: |
| 127 | UCHAR* ptr; |
| 128 | }; |
| 129 | |
| 130 | class InitialBlock : public MemoryBlock |
| 131 | { |