23#include <fmt/ostream.h>
24#include <nlohmann/json.hpp>
25using json = nlohmann::json;
70 GuiResult guiConfig(
const char* vFilters,
const std::vector<std::string>& extensions,
size_t id,
const std::string& nameId);
133 auto&
seekg(std::streamoff pos, std::ios_base::seekdir dir) {
return _filestream.seekg(pos, dir); }
175#ifndef DOXYGEN_IGNORE
178struct fmt::formatter<
NAV::FileReader::FileType> : ostream_formatter
nlohmann::json json
json namespace
The class is responsible for all time-related tasks.
bool initialize()
Initialize the file reader.
void restore(const json &j)
Restores the node from a json object.
auto peek()
Looking ahead in the stream.
bool good() const
Fast error checking.
std::string _path
Path to the file.
FileType
File Type Enumeration.
auto & ignore(std::streamsize count, int delim)
Extracts and discards characters from the input stream until and including delim.
std::ifstream _filestream
File stream to read the file.
FileReader & operator=(FileReader &&)=delete
Move assignment operator.
FileType _fileType
File Type.
virtual ~FileReader()=default
Destructor.
auto eof() const
Check whether the end of file is reached.
FileReader & operator=(const FileReader &)=delete
Copy assignment operator.
auto & read(char *__s, std::streamsize __n)
Extraction without delimiters.
std::filesystem::path getFilepath()
Returns the path of the file.
GuiResult
Results enum for the gui config.
@ PATH_UNCHANGED
No changes made.
@ PATH_CHANGED
The path changed and exists.
@ PATH_CHANGED_INVALID
The path changed but does not exist or is invalid.
std::vector< std::string > _headerColumns
Header Columns of a CSV file.
std::streampos tellg()
Getting the current read position.
virtual FileType determineFileType()
Virtual Function to determine the File Type.
GuiResult guiConfig(const char *vFilters, const std::vector< std::string > &extensions, size_t id, const std::string &nameId)
ImGui config.
FileReader(const FileReader &)=delete
Copy constructor.
void resetReader()
Moves the read cursor to the start.
auto & getline(std::string &str)
Reads a line from the filestream.
auto readsome(char *s, std::streamsize count)
Extracts up to count immediately available characters from the input stream. The extracted characters...
json save() const
Saves the node into a json object.
virtual void readHeader()
Virtual Function to read the Header of a file.
std::streampos _dataStart
Start of the data in the file.
FileReader()=default
Default constructor.
auto & seekg(std::streamoff pos, std::ios_base::seekdir dir)
Changing the current read position.
size_t getCurrentLineNumber() const
Get the current line number.
FileReader(FileReader &&)=delete
Move constructor.
size_t _lineCnt
Line counter.
size_t _lineCntDataStart
Line counter data start.
void deinitialize()
Deinitialize the file reader.