--- nono/lib/config.h 2026/04/29 17:05:08 1.1.1.4 +++ nono/lib/config.h 2026/04/29 17:05:12 1.1.1.5 @@ -26,7 +26,7 @@ #pragma once -#include "header.h" +#include "mainapp.h" #include // 設定の1項目 @@ -43,10 +43,11 @@ class ConfigItem public: ConfigItem() { } - ConfigItem(const std::string& key_, const std::string& val_, + ConfigItem(const std::string& key_, const std::string& val_, VMCap vmcap_, from_t from_, const std::string& where_) { key = key_; value = val_; + vmcap = vmcap_; from = from_; where = where_; } @@ -75,6 +76,9 @@ class ConfigItem // コンストラクタでこれを呼び出すこと。例えば mpu-clock など。 void SetDefault(const std::string& val); + // vmcap を取得する + VMCap GetVMCap() const { return vmcap; } + // from を取得する from_t GetFrom() const { return from; } @@ -98,6 +102,10 @@ class ConfigItem std::string key {}; std::string value {}; + // ケーパビリティ。 + // 機種確定後に、この機種に不要な変数は削除する。 + VMCap vmcap {}; + // from (と where) はこの変数の由来を示す。 // o FromOption なら値は -V オプションで指定されたことを示す。 // o FromConfig なら値は設定ファイルで指定されたことを示す。 @@ -156,9 +164,10 @@ class Config void SetDefault(const std::string& key, const std::string& value); // 項目を追加 - bool Add(const std::string& key); - bool Add(const std::string& key, int value); - bool Add(const std::string& key, const std::string& value); + bool Add(const std::string& key, VMCap vmcap = VMCap::ALL); + bool Add(const std::string& key, int value, VMCap vmcap = VMCap::ALL); + bool Add(const std::string& key, const std::string& value, + VMCap vmcap = VMCap::ALL); // 項目を削除 void Delete(const std::string& key);