NDEVR
API Documentation
INIInterface.h
1/*--------------------------------------------------------------------------------------------
2Copyright (c) 2019, NDEVR LLC
3tyler.parke@ndevr.org
4 __ __ ____ _____ __ __ _______
5 | \ | | | __ \ | ___|\ \ / / | __ \
6 | \ | | | | \ \ | |___ \ \ / / | |__) |
7 | . \| | | |__/ / | |___ \ V / | _ /
8 | |\ |_|_____/__|_____|___\_/____| | \ \
9 |__| \__________________________________| \__\
10
11Subject to the terms of the Enterprise+ Agreement, NDEVR hereby grants
12Licensee a limited, non-exclusive, non-transferable, royalty-free license
13(without the right to sublicense) to use the API solely for the purpose of
14Licensee's internal development efforts to develop applications for which
15the API was provided.
16
17The above copyright notice and this permission notice shall be included in all
18copies or substantial portions of the Software.
19
20THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
21INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
22PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
23FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25DEALINGS IN THE SOFTWARE.
26
27Library: Base
28File: INIInterface
29Included in API: True
30Author(s): Tyler Parke
31 *-----------------------------------------------------------------------------------------**/
32#pragma once
33#include "DLLInfo.h"
34#include <NDEVR/INIFactory.h>
35
36namespace NDEVR
37{
38 class InfoPipe;
39
46 class NDEVR_BASE_API INIInterface
47 {
48 public:
53
58 INIInterface(const File& default_ini);
59
63 virtual ~INIInterface(){}
64
70 virtual void writeToLog(LogPtr log, uint01 log_level = 2U);
71
78 virtual void writeToLog(const StringView& title, LogPtr log, uint01 log_level = 2U);
79
84 virtual void getINI(INIFactory& factory) = 0;
85
90 void setDefaultINIFile(const File& file);
91
96 virtual bool readINIOptions();
97
103 virtual bool readINIOptions(File& ini_file);
104
109 virtual void finishReadingINI(INIFactory&) {};
110
115 virtual void prepareForINI(INIFactory&) {};
116
122 virtual bool saveINIOptions(bool multithead = false);
123
130 virtual bool saveINIOptions(File& ini_file, bool multithead = false);
131 protected:
133 };
134};
135
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Definition File.h:53
Contains methods for easily reading and writing to an INI file including efficient casting,...
Definition INIReader.h:107
INIInterface(const File &default_ini)
Constructs an INIInterface with the specified default INI file.
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 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 void writeToLog(LogPtr log, uint01 log_level=2U)
Writes the current INI options to the specified log.
void setDefaultINIFile(const File &file)
Sets the default INI file path used for reading and writing options.
virtual bool saveINIOptions(File &ini_file, bool multithead=false)
Saves INI options to the specified INI file.
virtual bool saveINIOptions(bool multithead=false)
Saves INI options to the default INI file.
virtual void getINI(INIFactory &factory)=0
Populates the given INI factory with the options managed by this interface.
File m_default_ini
The default file path used for reading and writing INI options.
virtual void prepareForINI(INIFactory &)
Called before reading or writing an INI file.
virtual void finishReadingINI(INIFactory &)
Called after reading an INI file.
INIInterface()
Constructs an INIInterface with no default INI file.
virtual ~INIInterface()
Virtual destructor for safe polymorphic cleanup.
A light-weight base class for Log that allows processes to update, without the need for additional in...
A light-weight wrapper that will be a no-op if there is not a valid log reference,...
The core String View class for the NDEVR API.
Definition StringView.h:58
The primary namespace for the NDEVR SDK.
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...