GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
application_setting_record_validator.cpp
[詳解]
1
3
4// Copyright(c) 2023-2025 Design Engineering Laboratory, Saitama University
5// Released under the MIT license
6// https://opensource.org/licenses/mit-license.php
7
9
10#include <format>
11
12
13namespace designlab
14{
15
17 kErrorMesForWindowWidthGeMin(std::format(
18 "The window width should be set to a value greater than or equal to {}.",
19 ApplicationSettingRecord::kWindowWidthMin)),
20
21 kErrorMesForWindowWidthLeMax(std::format(
22 "The window width should be set to a value less than or equal to {}.",
23 ApplicationSettingRecord::kWindowWidthMax)),
24
25 kErrorMesForWindowHeightGeMin(std::format(
26 "The window height should be set to a value greater than or equal to {}.",
27 ApplicationSettingRecord::kWindowHeightMin)),
28
29 kErrorMesForWindowHeightLeMax(std::format(
30 "The window height should be set to a value less than or equal to {}.",
31 ApplicationSettingRecord::kWindowHeightMax)),
32
33 kErrorMesForFpsGeMin(std::format(
34 "FPS should be set to a value greater than {}.",
35 ApplicationSettingRecord::kFpsMin)),
36
37 kErrorMesForFpsLeMax(std::format(
38 "FPS should be set to a value less than or equal to {}.",
40{
41}
42
43std::tuple<bool, std::string> ApplicationSettingRecordValidator::Validate(
44 const ApplicationSettingRecord& setting_record) const
45
46{
48 {
49 return std::make_tuple(false, kErrorMesForWindowWidthGeMin);
50 }
51
53 {
54 return std::make_tuple(false, kErrorMesForWindowWidthLeMax);
55 }
56
58 {
59 return std::make_tuple(false, kErrorMesForWindowHeightGeMin);
60 }
61
63 {
64 return std::make_tuple(false, kErrorMesForWindowHeightLeMax);
65 }
66
68 {
69 return std::make_tuple(false, kErrorMesForFpsGeMin);
70 }
71
73 {
74 return std::make_tuple(false, kErrorMesForFpsLeMax);
75 }
76
77 return std::make_tuple(true, "");
78}
79
80} // namespace designlab
std::tuple< bool, std::string > Validate(const ApplicationSettingRecord &setting_record) const override
設定ファイルの内容を検証する.
Definition com_type.h:24
アプリの設定を記録する構造体.
int window_size_x
グラフィカルウィンドウの横幅.
int window_fps
グラフィカルウィンドウのFPS.
int window_size_y
グラフィカルウィンドウの縦幅.