--- nono/lib/config.cpp 2026/04/29 17:04:37 1.1.1.3 +++ nono/lib/config.cpp 2026/04/29 17:04:40 1.1.1.4 @@ -26,7 +26,7 @@ Config::Config() // 以下概ねアルファベット順に並べる // デバッガの TCP 待ち受けポート - Add("debugger-port", 9999); + Add("debugger-port", 0); Add("ethernet-hostdriver", "none"); Add("ethernet-macaddr", "auto"); // LUNA の DIPSW (1 が UP、0 が DOWN) @@ -49,6 +49,8 @@ Config::Config() for (int id = 0; id < 8; id++) { Add(string_format("spc0-id%d-image", id)); Add(string_format("spc0-id%d-writeprotect", id), 0); + // シークタイム [msec] + Add(string_format("spc0-id%d-seektime", id), 0); } } @@ -82,6 +84,21 @@ Config::Add(const std::string& key, cons return true; } +// 項目を削除 +// key が見付からなくても何もしない。key は複数登録されていることはないはず。 +void +Config::Delete(const std::string& key) +{ + for (auto it = list.begin(); it != list.end(); ++it) { + auto item = *it; + if (key == item.key) { + list.erase(it); + return; + } + } + assert(FindItem(key) == NULL); +} + // 設定ファイルの内容で上書きする bool Config::Update(const ConfigFile& file)