DotNameLib
Loading...
Searching...
No Matches
dotnamecpp::utils::FileReader Class Referencefinal

#include <FileReader.hpp>

Inheritance diagram for dotnamecpp::utils::FileReader:
Collaboration diagram for dotnamecpp::utils::FileReader:

Public Member Functions

 FileReader ()=default
 FileReader (const FileReader &)=delete
FileReaderoperator= (const FileReader &)=delete
 FileReader (FileReader &&)=delete
FileReaderoperator= (FileReader &&)=delete
 ~FileReader () override=default
Result< std::string, FileErrorread (const std::filesystem::path &filePath) const override
 Read the entire content of a file as a string.
Result< std::vector< uint8_t >, FileErrorreadBytes (const std::filesystem::path &filePath) const override
 Read the entire content of a file as a vector of bytes.
Result< std::vector< std::string >, FileErrorreadLines (const std::filesystem::path &filePath) const override
 Read the content of a file as a vector of lines.
bool exists (const std::filesystem::path &filePath) const override
 Check if a file exists.
Result< std::uintmax_t, FileErrorgetSize (const std::filesystem::path &filePath) const override
 Get the Size object.
Public Member Functions inherited from dotnamecpp::utils::IFileReader
virtual ~IFileReader ()=default

Constructor & Destructor Documentation

◆ FileReader() [1/3]

dotnamecpp::utils::FileReader::FileReader ( )
default
Here is the caller graph for this function:

◆ FileReader() [2/3]

dotnamecpp::utils::FileReader::FileReader ( const FileReader & )
delete
Here is the call graph for this function:

◆ FileReader() [3/3]

dotnamecpp::utils::FileReader::FileReader ( FileReader && )
delete
Here is the call graph for this function:

◆ ~FileReader()

dotnamecpp::utils::FileReader::~FileReader ( )
overridedefault

Member Function Documentation

◆ exists()

bool dotnamecpp::utils::FileReader::exists ( const std::filesystem::path & filePath) const
nodiscardoverridevirtual

Check if a file exists.

Parameters
filePath
Returns
true
false

Implements dotnamecpp::utils::IFileReader.

Here is the caller graph for this function:

◆ getSize()

Result< std::uintmax_t, FileError > dotnamecpp::utils::FileReader::getSize ( const std::filesystem::path & filePath) const
nodiscardoverridevirtual

Get the Size object.

Parameters
filePath
Returns
Result<std::uintmax_t, FileError>

Implements dotnamecpp::utils::IFileReader.

Here is the caller graph for this function:

◆ operator=() [1/2]

FileReader & dotnamecpp::utils::FileReader::operator= ( const FileReader & )
delete
Here is the call graph for this function:

◆ operator=() [2/2]

FileReader & dotnamecpp::utils::FileReader::operator= ( FileReader && )
delete
Here is the call graph for this function:

◆ read()

Result< std::string, FileError > dotnamecpp::utils::FileReader::read ( const std::filesystem::path & filePath) const
nodiscardoverridevirtual

Read the entire content of a file as a string.

Parameters
filePath
Returns
Result<std::string, FileError>

Implements dotnamecpp::utils::IFileReader.

Here is the caller graph for this function:

◆ readBytes()

Result< std::vector< uint8_t >, FileError > dotnamecpp::utils::FileReader::readBytes ( const std::filesystem::path & filePath) const
nodiscardoverridevirtual

Read the entire content of a file as a vector of bytes.

Parameters
filePath
Returns
Result<std::vector<uint8_t>, FileError>

Implements dotnamecpp::utils::IFileReader.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readLines()

Result< std::vector< std::string >, FileError > dotnamecpp::utils::FileReader::readLines ( const std::filesystem::path & filePath) const
nodiscardoverridevirtual

Read the content of a file as a vector of lines.

Parameters
filePath
Returns
Result<std::vector<std::string>, FileError>

Implements dotnamecpp::utils::IFileReader.

Here is the caller graph for this function:

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