8#ifndef HPP_ALIB_CONFIG_INIFILEFEEDER
9#define HPP_ALIB_CONFIG_INIFILEFEEDER 1
15namespace alib {
namespace config {
76 "Export or import sequence not completed before deleting the INI-file.\n"
123 "Export or import sequence not completed before starting a new one.\n"
146 ALIB_ERROR(
"CONFIG",
"No INI-file loaded when trying to end import/export." )
163 ALIB_ERROR(
"CONFIG",
"No INI-file loaded when trying to import data." )
196 auto remainder= cursor.
GoTo(path);
197 if( remainder.IsNotEmpty() )
199 ALIB_WARNING(
"CONFIG",
"Configuration variable path to export not found: ", path)
233 auto remainder= cursor.
GoTo(path);
234 if( remainder.IsNotEmpty() )
236 ALIB_WARNING(
"CONFIG",
"Configuration variable path to export not found: ", path)
256 std::pair<IniFile::Section*, IniFile::Entry*>
SearchEntry (
const String& path );
303 const NString& resourceCategory,
304 const NString& resourceNamePrefix );
ALIB_API bool SetWriteBackFlag(const String &path)
void ExportEnd(const lang::system::Path &path)
IniFile * ExportStart(const lang::system::Path &path)
ALIB_API int ExportSubTree(Configuration::Cursor cursor, bool directChildrenOnly=false)
void ExportEnd()
Closes and deletes the internal iniFile instance without writing an opened INI-file.
IniFile * ImportStart(const lang::system::Path &path)
ALIB_API std::pair< IniFile::Section *, IniFile::Entry * > SearchEntry(const Variable &variable)
Priority priority
The priority to use to define variables. Set with construction.
IniFileFeeder(Configuration &pConfiguration, Priority pPriority=Priority::ConfigFile)
String DefaultCommentPrefix
IniFile * iniFile
The INI-file. Created with methods ImportStart and ExportStart.
ALIB_API int AddResourcedSectionComments(ResourcePool &resourcePool, const NString &resourceCategory, const NString &resourceNamePrefix)
bool Export(const String &path)
int ExportSubTree(const String &path, bool directChildrenOnly=false)
ALIB_API int importSection(IniFile::Section §ion)
void ImportEnd()
Closes and deletes the internal iniFile instance.
ALIB_API bool Export(const Variable &var)
ALIB_API int ImportSection(const String §ionName)
Configuration & configuration
The configuration to work with. Set with construction.
lang::system::PathString FileName
The file name.
ALIB_API void Write(const lang::system::PathString &path=lang::system::NULL_PATH)
SubstringType GoTo(const NameType &path)
#define ALIB_WARNING(...)
#define ALIB_ASSERT_ERROR(cond,...)
#define ALIB_ASSERT_WARNING(cond,...)
config::Variable Variable
Type alias in namespace alib.
A section of the INI-file.