| 294 | } |
| 295 | |
| 296 | bool TOptsParser::Next() { |
| 297 | bool r = false; |
| 298 | |
| 299 | if (OptsDefault_.empty()) { |
| 300 | CurrentOpt_ = nullptr; |
| 301 | TempCurrentOpt_.Destroy(); |
| 302 | |
| 303 | CurrentValue_ = nullptr; |
| 304 | |
| 305 | if (Stopped_) |
| 306 | return false; |
| 307 | |
| 308 | TOptsParser copy = *this; |
| 309 | |
| 310 | r = copy.DoNext(); |
| 311 | |
| 312 | Swap(copy); |
| 313 | |
| 314 | if (!r) { |
| 315 | Stopped_ = true; |
| 316 | // we are done; check for missing options |
| 317 | Finish(); |
| 318 | } |
| 319 | } |
| 320 | |
| 321 | if (!r && !OptsDefault_.empty()) { |
| 322 | CurrentOpt_ = OptsDefault_.front(); |
| 323 | CurrentValue_ = CurrentOpt_->GetDefaultValue(); |
| 324 | OptsDefault_.pop_front(); |
| 325 | r = true; |
| 326 | } |
| 327 | |
| 328 | if (r) { |
| 329 | if (CurOpt()) |
| 330 | CurOpt()->FireHandlers(this); |
| 331 | } |
| 332 | |
| 333 | return r; |
| 334 | } |
| 335 | |
| 336 | void TOptsParser::Finish() { |
| 337 | const TOpts::TOptsVector& optvec = Opts_->Opts_; |
nothing calls this directly
no test coverage detected