0.4.1
Loading...
Searching...
No Matches
NAV::FileWriter Class Reference

Parent class for other data loggers which manages the output filestream. More...

Public Types

enum class  FileType : uint8_t {
  NONE ,
  BINARY ,
  ASCII
}
 File Type. More...
 

Public Member Functions

 FileWriter (const FileWriter &)=delete
 Copy constructor.
 
 FileWriter (FileWriter &&)=delete
 Move constructor.
 
FileWriteroperator= (const FileWriter &)=delete
 Copy assignment operator.
 
FileWriteroperator= (FileWriter &&)=delete
 Move assignment operator.
 
 ~FileWriter ()=default
 Destructor.
 

Static Public Member Functions

static const char * to_string (FileType type)
 Converts the provided type into string.
 

Protected Member Functions

void deinitialize ()
 Deinitialize the file reader.
 
 FileWriter ()=default
 Default constructor.
 
std::filesystem::path getFilepath ()
 Returns the path of the file.
 
bool guiConfig (const char *vFilters, const std::vector< std::string > &extensions, size_t id, const std::string &nameId)
 ImGui config.
 
bool initialize ()
 Initialize the file reader.
 
void restore (const json &j)
 Restores the node from a json object.
 
json save () const
 Saves the node into a json object.
 

Protected Attributes

std::ofstream _filestream
 File stream to write the file.
 
FileType _fileType
 File Type.
 
std::string _path
 Path to the file.
 

Detailed Description

Parent class for other data loggers which manages the output filestream.

Definition at line 26 of file FileWriter.hpp.

Member Enumeration Documentation

◆ FileType

enum class NAV::FileWriter::FileType : uint8_t
strong

File Type.

Enumerator
NONE 

Not specified.

BINARY 

Binary data.

ASCII 

Ascii text data.

Definition at line 30 of file FileWriter.hpp.

Constructor & Destructor Documentation

◆ ~FileWriter()

NAV::FileWriter::~FileWriter ( )
default

Destructor.

◆ FileWriter() [1/3]

NAV::FileWriter::FileWriter ( const FileWriter & )
delete

Copy constructor.

◆ FileWriter() [2/3]

NAV::FileWriter::FileWriter ( FileWriter && )
delete

Move constructor.

◆ FileWriter() [3/3]

NAV::FileWriter::FileWriter ( )
protecteddefault

Default constructor.

Member Function Documentation

◆ deinitialize()

void NAV::FileWriter::deinitialize ( )
protected

Deinitialize the file reader.

Definition at line 105 of file FileWriter.cpp.

◆ getFilepath()

std::filesystem::path NAV::FileWriter::getFilepath ( )
protected

Returns the path of the file.

Definition at line 34 of file FileWriter.cpp.

◆ guiConfig()

bool NAV::FileWriter::guiConfig ( const char * vFilters,
const std::vector< std::string > & extensions,
size_t id,
const std::string & nameId )
protected

ImGui config.

Parameters
[in]vFiltersFilter to apply for file names
[in]extensionsExtensions to filter
[in]idUnique id for creating the dialog uid
[in]nameIdName of the node triggering the window used for logging
Returns
True if changes occurred

Definition at line 20 of file FileWriter.cpp.

◆ initialize()

bool NAV::FileWriter::initialize ( )
protected

Initialize the file reader.

Definition at line 71 of file FileWriter.cpp.

◆ operator=() [1/2]

FileWriter & NAV::FileWriter::operator= ( const FileWriter & )
delete

Copy assignment operator.

◆ operator=() [2/2]

FileWriter & NAV::FileWriter::operator= ( FileWriter && )
delete

Move assignment operator.

◆ restore()

void NAV::FileWriter::restore ( const json & j)
protected

Restores the node from a json object.

Parameters
[in]jJson object with the node state

Definition at line 57 of file FileWriter.cpp.

◆ save()

json NAV::FileWriter::save ( ) const
nodiscardprotected

Saves the node into a json object.

Definition at line 45 of file FileWriter.cpp.

◆ to_string()

const char * NAV::FileWriter::to_string ( FileType type)
static

Converts the provided type into string.

Parameters
[in]typeFileType to convert
Returns
String representation of the type

Definition at line 124 of file FileWriter.cpp.

Field Documentation

◆ _filestream

std::ofstream NAV::FileWriter::_filestream
protected

File stream to write the file.

Definition at line 85 of file FileWriter.hpp.

◆ _fileType

FileType NAV::FileWriter::_fileType
protected

File Type.

Definition at line 88 of file FileWriter.hpp.

◆ _path

std::string NAV::FileWriter::_path
protected

Path to the file.

Definition at line 82 of file FileWriter.hpp.


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