0.2.0
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 {
  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.

Member Enumeration Documentation

◆ FileType

enum class NAV::FileWriter::FileType
strong

File Type.

Enumerator
NONE 

Not specified.

BINARY 

Binary data.

ASCII 

Ascii text data.

Member Function Documentation

◆ 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

◆ restore()

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

Restores the node from a json object.

Parameters
[in]jJson object with the node state

◆ to_string()

static 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

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