Base Framework
Public Member Functions | List of all members
FileRegion Class Reference

A region of a file. More...

#include <base/io/FileRegion.h>

Inherits Object.

Public Member Functions

 FileRegion (long long offset, unsigned int size)
 
 FileRegion (const FileRegion &copy) noexcept
 
FileRegionoperator= (const FileRegion &assign) noexcept
 
long long getOffset () const noexcept
 
unsigned int getSize () const noexcept
 
void setOffset (long long offset)
 
void setSize (unsigned int size)
 
long long getEnd () const noexcept
 
bool isWithin (const FileRegion &region) const noexcept
 

Detailed Description

A region of a file.

Description of a file region represented by an offset (64 bit) and a size (32 bit).

Version
1.1

Constructor & Destructor Documentation

◆ FileRegion() [1/2]

FileRegion::FileRegion ( long long  offset,
unsigned int  size 
)
inline

Initializes the file region.

Parameters
offsetThe offset (from the beginning of the file) of the region.
sizeThe size (in bytes) of the region.

◆ FileRegion() [2/2]

FileRegion::FileRegion ( const FileRegion copy)
inlinenoexcept

Initializes region from other region.

Member Function Documentation

◆ getEnd()

long long FileRegion::getEnd ( ) const
inlinenoexcept

Returns the end of the region.

◆ getOffset()

long long FileRegion::getOffset ( ) const
inlinenoexcept

Returns the offset of the file region.

◆ getSize()

unsigned int FileRegion::getSize ( ) const
inlinenoexcept

Returns the size of the file region.

◆ isWithin()

bool FileRegion::isWithin ( const FileRegion region) const
inlinenoexcept

Returns true if the specified region is contained in this region.

◆ operator=()

FileRegion& FileRegion::operator= ( const FileRegion assign)
inlinenoexcept

Assignment of region by region.

◆ setOffset()

void FileRegion::setOffset ( long long  offset)
inline

Sets the offset of the file region.

◆ setSize()

void FileRegion::setSize ( unsigned int  size)
inline

Sets the size of the file region.