General refactoring

This commit is contained in:
Ivan Morozov
2022-09-23 21:59:32 +03:00
parent a0970d0963
commit 029908f8a1
17 changed files with 98 additions and 115 deletions

View File

@ -7,8 +7,8 @@ using namespace CFCPP;
StreamView::StreamView(const SVector<Sector> &sectorChain, int sectorSize, Stream stream)
: sectorSize(sectorSize), sectorChain(sectorChain), stream(stream)
{
// if (sectorChain == null)
// throw CFException("Sector Chain cannot be null");
if (sectorChain == nullptr)
throw CFException("Sector Chain cannot be null");
if (sectorSize <= 0)
throw CFException("Sector size must be greater than zero");
@ -238,7 +238,17 @@ void StreamView::adjustLength(std::streamsize value, SList<Sector> &availableSec
}
}
std::streamsize StreamView::getPosition() const
{
return position;
}
std::streamsize StreamView::getLength() const
{
return length;
}
SVector<Sector> &StreamView::BaseSectorChain()
{
return sectorChain;
}