Trax3 3.1.0
trax track library
Loading...
Searching...
No Matches
trax::FileReader Class Referenceabstract

Base class for file readers. More...

#include <C:/Trend/Development/Trax3/Code/trax/rigid/trains/support/RollingStockFileReader.h>

Inheritance diagram for trax::FileReader:

Public Member Functions

 FileReader (std::filesystem::path basePath=std::filesystem::path{}) noexcept
bool operator() (std::filesystem::path filePath)
virtual bool Read (std::filesystem::path filePath)=0
 Reads an object from a file.

Protected Member Functions

std::filesystem::path GetBasePath () const noexcept
bool MakeValidPath (std::filesystem::path &path) const noexcept

Detailed Description

Base class for file readers.

Member Function Documentation

◆ Read()

virtual bool trax::FileReader::Read ( std::filesystem::path filePath)
pure virtual

Reads an object from a file.

Returns
true if the file could be read successfuly; false if the file could not be found.
Exceptions
std::runtime_erroron any kind of malformatted file content.

Implemented in trax::RollingStockFileReader, and trax::TrainFileReader.


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