diff --git a/Endian/IOBuffer.t.cpp b/Endian/IOBuffer.t.cpp index dfd4e6a..54de16a 100644 --- a/Endian/IOBuffer.t.cpp +++ b/Endian/IOBuffer.t.cpp @@ -38,19 +38,27 @@ void writeZero(unsigned count) { - uint8_t *cp = _offset + (uint8_t *)_buffer; - for (unsigned i = 0; i < count; ++i) - { - cp[i] = 0; - } + std::memset(_offset + (uint8_t *)_buffer, 0, count); + _offset += count; } unsigned offset() const { return _offset; } void setOffset(unsigned offset) { _offset = offset; } + void setOffset(unsigned offset, bool zero) + { + if (zero && offset > _offset) + { + writeZero(offset - _offset); + } + else setOffset(offset); + } + unsigned size() const { return _size; } + void *buffer() const { return _buffer; } + private: void *_buffer; unsigned _size; diff --git a/DateTime.cpp b/ProDOS/DateTime.cpp similarity index 100% rename from DateTime.cpp rename to ProDOS/DateTime.cpp diff --git a/DateTime.h b/ProDOS/DateTime.h similarity index 100% rename from DateTime.h rename to ProDOS/DateTime.h