XDGKit v1.0.0-1
C++ XDG Utilities
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
XDGINI Class Reference

A parsed INI file. More...

#include <XDGINI.h>

+ Inheritance diagram for XDGINI:

Public Member Functions

uint64_t nBytes () const noexcept
 Sum of all key/value string sizes (including the '\0' terminators)
 

Static Public Member Functions

static std::shared_ptr< XDGINILoadFile (const std::filesystem::path &iniFile) noexcept
 Loads and parses an INI file.
 

Detailed Description

A parsed INI file.

The content is organized in nested unordered maps. The top-level map represents the sections, while the nested maps hold the key-value pairs within each section.

All values are stored as strings.

Example usage:

const std::string &value = parsedIni["section"]["key"];

Member Function Documentation

◆ LoadFile()

std::shared_ptr< XDGINI > LoadFile ( const std::filesystem::path &  iniFile)
staticnoexcept

Loads and parses an INI file.

Parameters
iniFileThe path to the INI file to be loaded and parsed.
Returns
Always returns a valid pointer to an XDGINI object. The returned pointer may reference an empty object if an error occurs.

◆ nBytes()

uint64_t nBytes ( ) const
inlinenoexcept

Sum of all key/value string sizes (including the '\0' terminators)