FreeNOS
Public Member Functions
Storage Class Referenceabstract

Provides a storage device to build filesystems on top. More...

#include <Storage.h>

Inheritance diagram for Storage:
BootImageStorage BootSymbolStorage FileStorage

Public Member Functions

 Storage ()
 Constructor function. More...
 
virtual ~Storage ()
 Destructor function. More...
 
virtual FileSystem::Result initialize ()=0
 Initialize the Storage device. More...
 
virtual FileSystem::Result read (const u64 offset, void *buffer, const Size size) const =0
 Read a contiguous set of data. More...
 
virtual FileSystem::Result write (const u64 offset, void *buffer, const Size size)
 Write a contiguous set of data. More...
 
virtual u64 capacity () const =0
 Retrieve maximum storage capacity. More...
 

Detailed Description

Provides a storage device to build filesystems on top.

Definition at line 35 of file Storage.h.

Constructor & Destructor Documentation

◆ Storage()

Storage::Storage ( )

Constructor function.

Definition at line 21 of file Storage.cpp.

◆ ~Storage()

Storage::~Storage ( )
virtual

Destructor function.

Definition at line 25 of file Storage.cpp.

Member Function Documentation

◆ capacity()

virtual u64 Storage::capacity ( ) const
pure virtual

Retrieve maximum storage capacity.

Returns
Storage capacity.

Implemented in FileStorage, BootImageStorage, and BootSymbolStorage.

◆ initialize()

virtual FileSystem::Result Storage::initialize ( )
pure virtual

Initialize the Storage device.

Returns
Result code

Implemented in BootImageStorage, BootSymbolStorage, and FileStorage.

◆ read()

virtual FileSystem::Result Storage::read ( const u64  offset,
void *  buffer,
const Size  size 
) const
pure virtual

Read a contiguous set of data.

Parameters
offsetOffset to start reading from.
bufferOutput buffer.
sizeNumber of bytes to copied.
Returns
Result code

Implemented in BootImageStorage, BootSymbolStorage, and FileStorage.

Referenced by LinnFileSystem::getInode(), LinnDirectory::getLinnDirectoryEntry(), LinnFileSystem::getOffsetRange(), LinnFileSystem::LinnFileSystem(), LinnFile::read(), and LinnDirectory::read().

◆ write()

FileSystem::Result Storage::write ( const u64  offset,
void *  buffer,
const Size  size 
)
virtual

Write a contiguous set of data.

Parameters
offsetOffset to start writing to.
bufferInput buffer.
sizeNumber of bytes to written.
Returns
Result code

Reimplemented in FileStorage.

Definition at line 29 of file Storage.cpp.

References FileSystem::NotSupported.


The documentation for this class was generated from the following files: