259 if( section.Name.IsNotEmpty() && section.Comments.IsNull() )
261 "Hint: New section \"{}\", which was programmatically added to\n"
262 " INI-file \"{}\", has no comments.",
322 if( section ==
nullptr )
#define ALIB_WARNING(domain,...)
#define ALIB_BOXING_VTABLE_DECLARE(TMapped, Identifier)
constexpr bool IsEmpty() const
std::size_t HashcodeIgnoreCase() const
bool Equals(const TString< TChar > &rhs) const
void Reset()
Clears all data, resets the internal mono allocator.
Entry * DeleteEntry(Section *section, const String &name)
Section * CreateSection(const String &name)
void Write(const system::PathString &path=system::NULL_PATH)
Entry * CreateEntry(Section *section, const String &name)
void AddComments(String &dest, const String &comments, const String &prefix=A_CHAR("# "))
HashMap< MonoAllocator, EntryKey, Handle, EntryKey::Hash, EntryKey::EqualTo > entryTable
ListMA< integer > LinesWithReadErrors
system::PathString FileName
The file name.
bool startsWithCommentSymbol(String &subs)
Handle SearchEntry(const String §ion, const String &name)
int Read(const system::CPathString &path)
std::pair< Section *, bool > SearchOrCreateSection(const String §ionName)
ListMA< Section > Sections
The list of sections.
Entry * DeleteEntry(const String §ionName, const String &name)
IniFile()
Default constructor.
Section * DeleteSection(const String &name)
MonoAllocator Allocator
A monotonic allocator used for allocating sections and entries.
Section * SearchSection(const String §ionName)
IniFile(const system::Path &path)
String FileComments
The file header which will be written out as comment lines with "# " prefixes.
#define ALIB_ENUMS_ASSIGN_RECORD(TEnum, TRecord)
strings::TCString< PathCharType > CPathString
The string-type used with this ALib Module.
strings::TString< PathCharType > PathString
The string-type used with this ALib Module.
constexpr PathString NULL_PATH
A nulled path string.
@ ErrorWritingFile
An error occurred writing the file .
@ ErrorOpeningFile
File not found when reading.
monomem::TMonoAllocator< lang::HeapAllocator > MonoAllocator
constexpr String NULL_STRING
A nulled string of the default character type.
containers::List< T, MonoAllocator, TRecycling > ListMA
Type alias in namespace alib.
lang::integer integer
Type alias in namespace alib.
containers::HashMap< TAllocator, TKey, TMapped, THash, TEqual, THashCaching, TRecycling > HashMap
Type alias in namespace alib.
strings::TString< character > String
Type alias in namespace alib.
Equality functor for nodes hashed in field #"entryTable".
bool operator()(const EntryKey &lhs, const EntryKey &rhs) const
Hash functor for nodes hashed in field #"entryTable".
std::size_t operator()(const EntryKey &key) const
EntryKey(const String §ionName, const String &entryName)
const String & EntryName
The name of the entry.
const String & SectionName
The name of the section.
An entry in a #"IniFile::Section".
String NewValue
If this value is set, #"RawValue" will be ignored on writing.
String Name
The entry's name.
String Comments
The entry's comments.
int LineNo
If given, the line number in the source file.
bool WriteBack
If given, a write back indicator was found for this entry.
A pair of pointers to a section and an entry in the section.
Entry * EntryPointer
Pointer to the entry in the #"SectionPointer".
Section * SectionPointer
Pointer to the INI-file's section.
A section of the INI-file.
String Comments
The comment lines of the section.
Section(MonoAllocator &monoAllocator)
ListMA< Entry, Recycling::None > Entries
The list of variables of the section.
bool WriteBack
If given, a write back indicator was found for this entry.
String Name
The name of the section.