Commit c2c9c8bc authored by jan.koester's avatar jan.koester
Browse files

inital support regedit

parent b6e4cdfb
Loading
Loading
Loading
Loading
+28 −2
Original line number Diff line number Diff line
@@ -172,7 +172,33 @@ namespace confplus {
                );
                
                std::string cname = currentConfigPath;
                size_t pos = 0;
                bool is_array_index = true;
                if (valueNameStr != "@DEFAULT") {
                    for (char c : valueNameStr) {
                        if (!std::isdigit(c)) {
                            is_array_index = false;
                            break;
                        }
                    }

                    if (is_array_index) {
                        try {
                            pos = std::stoul(valueNameStr);
                        } catch (...) {
                            is_array_index = false; 
                            pos = 0;
                        }
                    }
                } else {
                    is_array_index = false;
                }


                if (!is_array_index) {
                    cname += "/" + valueNameStr;
                    pos = 0;
                }
                
                std::string cvalue;

@@ -195,7 +221,7 @@ namespace confplus {
                }
                
                Config::ConfigData* ckey = conf->setKey(cname);
                conf->setValue(ckey, 0, cvalue);
                conf->setValue(ckey, pos, cvalue);
            }

            // --- 4. Subkeys (Unterschlüssel) zur Stack hinzufügen ---