// config_updater.h — Universal INI config file updater (like insert_or_replace_option in utun) #ifndef CONFIG_UPDATER_H #define CONFIG_UPDATER_H #include #include enum ConfigUpdateFlag { CONFIG_UPDATE_REPLACE = 0, // replace existing param (single value) CONFIG_UPDATE_APPEND = 1 // add new param even if exists (multi-value) }; // Batch update — for callers that read/write the file once (e.g. NodeConfig::save) bool config_update_in_lines(QStringList& lines, const QString& section, const QString& key, const QString& value, bool replace); // File-level wrapper — reads, updates, writes bool config_update_option(const QString& filePath, const QString& section, const QString& param, const QString& value, int flags = CONFIG_UPDATE_REPLACE); #endif // CONFIG_UPDATER_H