MCPcopy Create free account
hub / github.com/Martchus/syncthingtray / assignIntegerFromArg

Function assignIntegerFromArg

cli/application.cpp:169–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

167}
168
169static int assignIntegerFromArg(const Argument &arg, int &integer)
170{
171 if (!arg.isPresent()) {
172 return 0;
173 }
174 try {
175 integer = stringToNumber<int>(arg.firstValue());
176 if (integer < 0) {
177 throw ConversionException();
178 }
179 } catch (const ConversionException &) {
180 cerr << Phrases::Error << "The specified number of milliseconds \"" << arg.firstValue() << "\" is no unsigned integer." << Phrases::EndFlush;
181 return -4;
182 }
183 return 0;
184}
185
186int Application::loadConfig()
187{

Callers 1

loadConfigMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected