MVault 1.0.0
Simple c++ database
Loading...
Searching...
No Matches
Public Member Functions | List of all members
mvlt::StreamFileReader Class Reference

A class for reading files as a stream. More...

#include <StreamFileReader.h>

Public Member Functions

 StreamFileReader () noexcept
 Default constructor.
 
 StreamFileReader (const StreamFileReader &other) noexcept=delete
 Copy constructor.
 
 StreamFileReader (StreamFileReader &&other) noexcept=delete
 Move constructor.
 
 StreamFileReader (const std::string &fileName) noexcept
 Constructor.
 
StreamFileReaderoperator= (const StreamFileReader &other) noexcept=delete
 Assignment operator.
 
StreamFileReaderoperator= (StreamFileReader &&other) noexcept=delete
 Move assignment operator.
 
bool Open (const std::string &fileName) noexcept
 Method for opening the file.
 
bool IsOpen () const noexcept
 Method for checking whether the file has been opened.
 
bool IsEnd () const noexcept
 A method for checking if a file has been read.
 
std::size_t GetFileSize () const noexcept
 A method for get file size.
 
std::size_t GetCurrentPos () const noexcept
 A method for get current reading position.
 
char GetChar () const noexcept
 Method for getting the current character.
 
char GetNextChar () const noexcept
 Method for getting the next character.
 
bool Move () noexcept
 A method for moving through a file.
 
void Close () noexcept
 Method for closing a file.
 
 ~StreamFileReader () noexcept
 Default destructor.
 

Detailed Description

A class for reading files as a stream.

Small files will be fully loaded into RAM. A large file is considered to be a file larger than BIG_FILE_SIZE. Large files will be read in chunks, the size of FILE_BLOCK_SIZE. At the same time, there will be no difference in interaction for the user of the class.

Constructor & Destructor Documentation

◆ StreamFileReader() [1/4]

mvlt::StreamFileReader::StreamFileReader ( )
noexcept

Default constructor.

Todo:
Wait new lcc version to make it default

◆ StreamFileReader() [2/4]

mvlt::StreamFileReader::StreamFileReader ( const StreamFileReader other)
deletenoexcept

Copy constructor.

Parameters
[in]otherobject to copy

◆ StreamFileReader() [3/4]

mvlt::StreamFileReader::StreamFileReader ( StreamFileReader &&  other)
deletenoexcept

Move constructor.

Parameters
[in]otherobject to move

◆ StreamFileReader() [4/4]

mvlt::StreamFileReader::StreamFileReader ( const std::string &  fileName)
explicitnoexcept

Constructor.

Parameters
[in]fileNamefile to open

Member Function Documentation

◆ GetChar()

char mvlt::StreamFileReader::GetChar ( ) const
noexcept

Method for getting the current character.

Returns
current char

◆ GetCurrentPos()

std::size_t mvlt::StreamFileReader::GetCurrentPos ( ) const
noexcept

A method for get current reading position.

Returns
current reading position

◆ GetFileSize()

std::size_t mvlt::StreamFileReader::GetFileSize ( ) const
noexcept

A method for get file size.

Returns
file size

◆ GetNextChar()

char mvlt::StreamFileReader::GetNextChar ( ) const
noexcept

Method for getting the next character.

Returns
next char

◆ IsEnd()

bool mvlt::StreamFileReader::IsEnd ( ) const
noexcept

A method for checking if a file has been read.

Returns
true if the file has been read, otherwise returns false

◆ IsOpen()

bool mvlt::StreamFileReader::IsOpen ( ) const
noexcept

Method for checking whether the file has been opened.

Returns
true if the file was opened, otherwise returns false

◆ Move()

bool mvlt::StreamFileReader::Move ( )
noexcept

A method for moving through a file.

Returns
true if the next character exists, otherwise false

◆ Open()

bool mvlt::StreamFileReader::Open ( const std::string &  fileName)
noexcept

Method for opening the file.

Parameters
[in]fileNamefile to open
Returns
true if the file was opened, otherwise returns false

◆ operator=() [1/2]

StreamFileReader & mvlt::StreamFileReader::operator= ( const StreamFileReader other)
deletenoexcept

Assignment operator.

Parameters
[in]otherobject to copy
Returns
new object with data from other

◆ operator=() [2/2]

StreamFileReader & mvlt::StreamFileReader::operator= ( StreamFileReader &&  other)
deletenoexcept

Move assignment operator.

Parameters
[in]otherobject to move
Returns
new object with data from other

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