|
bitrl & cuberl Documentation
Simulation engine for reinforcement learning agents
|
The FileWriterBase class. More...
#include <file_writer_base.h>


Public Member Functions | |
| FileWriterBase ()=default | |
| Default ctor. | |
| FileWriterBase (const std::string &file_name, FileFormats::Type t) | |
| Constructor. Construct by passing the name of the file to write into. | |
| virtual | ~FileWriterBase () |
| Destructor. | |
| virtual void | open () override |
| Open the file for writing. | |
| char | get_comment_mark () const |
| Return the mark that signifies the beginning of a comment line. | |
| void | set_comment_mark (char mark) |
| Set the comment mark. | |
| virtual void | write_header () |
| Write the header of the file. By default some information such as date and time the file was created is written. | |
Public Member Functions inherited from bitrl::utils::io::FileHandlerBase< std::ofstream > | |
| virtual | ~FileHandlerBase () |
| Constructor. | |
| FileFormats::Type | get_type () const noexcept |
| Returns the type of the file. | |
| handler_type & | get_file_stream () noexcept |
| Returns the underlying file stream. | |
| const handler_type & | get_file_stream () const noexcept |
| Returns the underlying file stream. | |
| std::string | get_filename () const noexcept |
| Returns the filename that is used to write. | |
| bool | is_open () const noexcept |
| Return true if and only if the file is open. | |
| virtual void | close () |
| Close the file. Return true if and only if the file was closed successfully false otherwise. | |
Static Public Member Functions | |
| static char | default_comment_mark () |
| The default comment mark. | |
Protected Attributes | |
| char | comment_mark_ |
| The mark that signifies the beginning of a comment line. The default is #. | |
Protected Attributes inherited from bitrl::utils::io::FileHandlerBase< std::ofstream > | |
| std::string | file_name_ |
| The name of the file to write. | |
| const FileFormats::Type | t_ |
| The format of the file. | |
| handler_type | f_ |
| The low level file handler. | |
Additional Inherited Members | |
Public Types inherited from bitrl::utils::io::FileHandlerBase< std::ofstream > | |
| typedef std::ofstream | handler_type |
Protected Member Functions inherited from bitrl::utils::io::FileHandlerBase< std::ofstream > | |
| FileHandlerBase (const std::string &file_name, FileFormats::Type t) | |
| protected Constructor so that explicit instantiation of the class fails | |
The FileWriterBase class.
|
default |
Default ctor.
| FileWriterBase::FileWriterBase | ( | const std::string & | file_name, |
| FileFormats::Type | t | ||
| ) |
Constructor. Construct by passing the name of the file to write into.
|
virtual |
Destructor.
The default comment mark.
|
inline |
Return the mark that signifies the beginning of a comment line.
|
overridevirtual |
Open the file for writing.
attempt to split the file name and check if a suffix has been given if yes check if this is the same with the file type
Implements bitrl::utils::io::FileHandlerBase< std::ofstream >.
|
virtual |
Write the header of the file. By default some information such as date and time the file was created is written.
|
protected |
The mark that signifies the beginning of a comment line. The default is #.