--- nono/lib/config.h 2026/04/29 17:05:22 1.1.1.8 +++ nono/lib/config.h 2026/04/29 17:05:39 1.1.1.10 @@ -41,6 +41,7 @@ class ConfigItem FromHome, // 共通設定ファイル(~/.nono.cfg)で更新 FromConfig, // VM 設定ファイルで更新 FromOption, // コマンドライン引数で更新 + FromPerf, // --perf オプション(を展開したもの)で更新 }; public: @@ -73,6 +74,11 @@ class ConfigItem // double 値として評価出来ないときは false を返す。 bool TryDouble(double *val) const; + // 値を固定小数点数として取得する。 + // 変換できたら true を返す。 + // 数値として評価出来ないときは false を返す。 + bool TryFixedDecimal(int *val, int digit) const; + // デフォルト値を差し替える。 // この変数が FromInitial なら値(初期値)を val に差し替える。この時 // from は FromInitial のまま。 @@ -198,8 +204,8 @@ class Config ConfigItem *FindItem(const std::string& key); // 更新1行分の共通処理 - bool UpdateLine(const std::string& line, ConfigItem::from_t, - const std::string& from); + bool UpdateLine(const std::string& line, ConfigItem::from_t from, + const std::string& where); // キーの正規名を返す const std::string& GetCanonKey(const std::string& key) const;