--- nono/lib/config.h 2026/04/29 17:05:44 1.1.1.11 +++ nono/lib/config.h 2026/04/29 17:05:52 1.1.1.12 @@ -28,6 +28,7 @@ #pragma once #include "mainapp.h" +#include #include // 設定の1項目 @@ -201,6 +202,9 @@ class Config // エイリアスを追加 bool AddAlias(const std::string& alias, const std::string& key); + // 廃止項目を追加 + void AddObsolete(const std::string& old, const std::string& alter); + // 項目を削除 void Delete(const std::string& key); @@ -223,12 +227,20 @@ class Config static bool SplitKeyVal(std::string *keyp, std::string *valp, const std::string& line); + // key が obsolete[] に含まれていれば true を返す。 + bool IsObsolete(const std::string& key) const { + return (obsolete.find(key) != obsolete.end()); + } + // 設定項目の集合 std::vector list {}; // エイリアス(別名)の集合 std::vector> aliases {}; + // 廃止項目名の集合 + std::map obsolete {}; + // 設定はある時点までは追加更新可能だが、途中からは読み込み専用としたい。 // プログラムミスを避けるため。 bool fixed {};