MCPcopy Create free account
hub / github.com/Pagghiu/SaneCppLibraries / parsePortOffset

Function parsePortOffset

Libraries/Testing/Testing.cpp:173–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171}
172
173static bool parsePortOffset(const char* value, uint16_t& parsedOffset)
174{
175 if (value == nullptr or *value == '\0')
176 {
177 return false;
178 }
179
180 uint32_t parsed = 0;
181 for (const char* ch = value; *ch != '\0'; ++ch)
182 {
183 if (*ch < '0' or *ch > '9')
184 {
185 return false;
186 }
187 parsed = parsed * 10 + static_cast<uint32_t>(*ch - '0');
188 if (parsed > 65535)
189 {
190 return false;
191 }
192 }
193 parsedOffset = static_cast<uint16_t>(parsed);
194 return true;
195}
196
197static Result getDirectoryName(StringSpan path, StringPath& directory)
198{

Callers 1

TestReportMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected