NDEVR
API Documentation
INIInterfaceabstract

Contains methods for easily reading and writing to an INI file including efficient casting, callback, and variable storage methods. More...

Inheritance diagram for INIInterface:
[legend]
Collaboration diagram for INIInterface:
[legend]

Public Member Functions

 INIInterface ()
 Constructs an INIInterface with no default INI file.
 INIInterface (const File &default_ini)
 Constructs an INIInterface with the specified default INI file.
virtual ~INIInterface ()
 Virtual destructor for safe polymorphic cleanup.
virtual void finishReadingINI (INIFactory &)
 Called after reading an INI file.
virtual void getINI (INIFactory &factory)=0
 Populates the given INI factory with the options managed by this interface.
virtual void prepareForINI (INIFactory &)
 Called before reading or writing an INI file.
virtual bool readINIOptions ()
 Reads INI options from the default INI file.
virtual bool readINIOptions (File &ini_file)
 Reads INI options from the specified INI file.
virtual bool saveINIOptions (bool multithead=false)
 Saves INI options to the default INI file.
virtual bool saveINIOptions (File &ini_file, bool multithead=false)
 Saves INI options to the specified INI file.
void setDefaultINIFile (const File &file)
 Sets the default INI file path used for reading and writing options.
virtual void writeToLog (const StringView &title, LogPtr log, uint01 log_level=2U)
 Writes the current INI options to the specified log with a title.
virtual void writeToLog (LogPtr log, uint01 log_level=2U)
 Writes the current INI options to the specified log.

Protected Attributes

File m_default_ini
 The default file path used for reading and writing INI options.

Detailed Description

Contains methods for easily reading and writing to an INI file including efficient casting, callback, and variable storage methods.


See also
INIFactory

Definition at line 46 of file INIInterface.h.

Constructor & Destructor Documentation

◆ INIInterface()

INIInterface::INIInterface ( const File & default_ini)

Constructs an INIInterface with the specified default INI file.

Parameters
[in]default_iniThe file path to use as the default INI file.

Member Function Documentation

◆ finishReadingINI()

virtual void INIInterface::finishReadingINI ( INIFactory & )
inlinevirtual

Called after reading an INI file.

Override to perform post-read processing.

Parameters
[in]factoryThe INI factory that was used during reading.

Reimplemented in CollimatorLogic, FactoryOptions, FileChooserDialog, MainGPSManager, NDEVRServerManager, UnitManager, and ViewportLayout.

Definition at line 109 of file INIInterface.h.

◆ getINI()

virtual void INIInterface::getINI ( INIFactory & factory)
pure virtual

Populates the given INI factory with the options managed by this interface.

Parameters
[in]factoryThe INI factory to populate with option definitions.

Implemented in BasicKeyController, CollimatorLogic, DesignSettings, DeviCounterSettings, FactoryOptions, FileChooserDialog, IMUCalibrator, JorvikTotalStation, JoystickSettings, MainGPSManager, MouseController, NDEVRProxyStyle, NDEVRServerManager, PhotogrammetryOptions, PointScannerOptions, RasterInfo, Translator, UnitManager, VehicleSearchItem, and ViewportLayout.

◆ prepareForINI()

virtual void INIInterface::prepareForINI ( INIFactory & )
inlinevirtual

Called before reading or writing an INI file.

Override to perform pre-processing.

Parameters
[in]factoryThe INI factory that will be used during reading or writing.

Reimplemented in CollimatorLogic, FactoryOptions, FileChooserDialog, NDEVRServerManager, and UnitManager.

Definition at line 115 of file INIInterface.h.

◆ readINIOptions() [1/2]

virtual bool INIInterface::readINIOptions ( )
virtual

Reads INI options from the default INI file.

Returns
True if the options were read successfully, false otherwise.

◆ readINIOptions() [2/2]

virtual bool INIInterface::readINIOptions ( File & ini_file)
virtual

Reads INI options from the specified INI file.

Parameters
[in]ini_fileThe INI file to read options from.
Returns
True if the options were read successfully, false otherwise.

◆ saveINIOptions() [1/2]

virtual bool INIInterface::saveINIOptions ( bool multithead = false)
virtual

Saves INI options to the default INI file.

Parameters
[in]multitheadWhether to perform the save on a background thread.
Returns
True if the options were saved successfully, false otherwise.

◆ saveINIOptions() [2/2]

virtual bool INIInterface::saveINIOptions ( File & ini_file,
bool multithead = false )
virtual

Saves INI options to the specified INI file.

Parameters
[in]ini_fileThe INI file to save options to.
[in]multitheadWhether to perform the save on a background thread.
Returns
True if the options were saved successfully, false otherwise.

◆ setDefaultINIFile()

void INIInterface::setDefaultINIFile ( const File & file)

Sets the default INI file path used for reading and writing options.

Parameters
[in]fileThe file path to set as the default INI file.

◆ writeToLog() [1/2]

virtual void INIInterface::writeToLog ( const StringView & title,
LogPtr log,
uint01 log_level = 2U )
virtual

Writes the current INI options to the specified log with a title.

Parameters
[in]titleThe title to prepend to the log output.
[in]logThe log to write to.
[in]log_levelThe verbosity level for logging.

◆ writeToLog() [2/2]

virtual void INIInterface::writeToLog ( LogPtr log,
uint01 log_level = 2U )
virtual

Writes the current INI options to the specified log.

Parameters
[in]logThe log to write to.
[in]log_levelThe verbosity level for logging.

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