/* */ #include "AbstractSingleDiskAdaptor.h" #include "File.h" #include "SingleFileAllocationIterator.h" void AbstractSingleDiskAdaptor::initAndOpenFile() { diskWriter->initAndOpenFile(getFilePath(), totalLength); } void AbstractSingleDiskAdaptor::openFile() { diskWriter->openFile(getFilePath(), totalLength); } void AbstractSingleDiskAdaptor::closeFile() { diskWriter->closeFile(); } void AbstractSingleDiskAdaptor::openExistingFile() { diskWriter->openExistingFile(getFilePath(), totalLength); } void AbstractSingleDiskAdaptor::writeData(const unsigned char* data, int32_t len, int64_t offset) { diskWriter->writeData(data, len, offset); } int32_t AbstractSingleDiskAdaptor::readData(unsigned char* data, int32_t len, int64_t offset) { return diskWriter->readData(data, len, offset); } bool AbstractSingleDiskAdaptor::fileExists() { return File(getFilePath()).exists(); } FileAllocationIteratorHandle AbstractSingleDiskAdaptor::fileAllocationIterator() { return new SingleFileAllocationIterator(this); }