inLimbo
TUI Music Player that keeps you in Limbo.
 
Loading...
Searching...
No Matches
properties.hpp File Reference
#include "../parser/toml_parser.hpp"
#include <iostream>
#include <string_view>
#include <unordered_map>

Go to the source code of this file.

Classes

struct  GlobalProps
 Struct to hold global property settings. More...
 

Functions

auto parseProps () -> GlobalProps
 Parses the global properties from the TOML configuration.
 

Function Documentation

◆ parseProps()

auto parseProps ( ) -> GlobalProps

Parses the global properties from the TOML configuration.

This function reads the global property configurations from the TOML file and returns a populated GlobalProps struct. Unlike parseKeybinds, this function will warn on errors but continue execution.

Returns
A GlobalProps struct with the configured settings.

Reports a warning for invalid property values.

This lambda function prints a warning message when an invalid property is detected, but allows the program to continue with a default value.

Parameters
fieldThe field in which the invalid value was found.
valueThe value that was invalid.
default_valThe default value that will be used instead.

Handles boolean property parsing with error checking.

This lambda function safely converts string values to booleans, providing appropriate warnings for invalid values.

Parameters
valueThe string value to convert.
fieldThe field name for error reporting.
default_valThe default boolean value to use if parsing fails.
Returns
The parsed boolean value or the default.