1#ifndef BITSIM_UTILS_IO_FILE_HANDLER_BASE_H
2#define BITSIM_UTILS_IO_FILE_HANDLER_BASE_H
5#include "boost/noncopyable.hpp"
180template <
typename HandlerType>
std::string get_filename() const noexcept
Returns the file name associated with this handler.
Definition file_handler_base.h:99
std::string file_name_
The name of the file to read from or write to.
Definition file_handler_base.h:162
handler_type f_
The underlying file stream/handler.
Definition file_handler_base.h:177
std::filesystem::path get_file_path() const noexcept
Returns the file path associated with this handler.
Definition file_handler_base.h:106
FileHandlerBase(const std::string &file_name, FileFormats::Type t)
Protected constructor.
Definition file_handler_base.h:181
const FileFormats::Type t_
The format/type of the file.
Definition file_handler_base.h:169
const handler_type & get_file_stream() const noexcept
Provides read-only access to the underlying file stream.
Definition file_handler_base.h:92
bool is_open() const noexcept
Checks whether the file is currently open.
Definition file_handler_base.h:113
FileFormats::Type get_type() const noexcept
Returns the type/format of the file.
Definition file_handler_base.h:77
virtual void close()
Closes the file if it is currently open.
Definition file_handler_base.h:188
virtual ~FileHandlerBase()
Destructor. Ensures that the file is properly closed.
Definition file_handler_base.h:186
handler_type & get_file_stream() noexcept
Provides mutable access to the underlying file stream.
Definition file_handler_base.h:85
virtual void open()=0
Opens the file.
HandlerType handler_type
Definition file_handler_base.h:62
Definition csv_file_reader.cpp:12
Definition dc_motor_backend_base.h:9