MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / read_bool

Function read_bool

src/SB/Game/zTalkBox.cpp:134–166  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132 }
133
134 static bool read_bool(const substr& s, bool def)
135 {
136 static const substr positive[6] = { { "yes", 3 }, { "y", 1 }, { "1", 1 },
137 { "true", 4 }, { "t", 1 }, { "on", 2 }
138
139 };
140 static const substr negative[6] = { { "no", 3 }, { "n", 1 }, { "0", 1 },
141 { "false", 5 }, { "f", 1 }, { "off", 3 }
142
143 };
144 if (def)
145 {
146 for (U32 i = 0; i < 6; i++)
147 {
148 if (icompare(s, negative[i]) == 0)
149 {
150 return false;
151 }
152 }
153 return true;
154 }
155 else
156 {
157 for (U32 i = 0; i < 6; i++)
158 {
159 if (icompare(s, positive[i]) == 0)
160 {
161 return true;
162 }
163 }
164 return false;
165 }
166 }
167
168 static void reset_auto_wait()
169 {

Callers 5

load_wait_contextFunction · 0.70
parse_tag_auto_waitFunction · 0.70
parse_tag_signalFunction · 0.70
parse_tag_allow_quitFunction · 0.70
parse_tag_trapFunction · 0.70

Calls 1

icompareFunction · 0.50

Tested by

no test coverage detected