----------------------------------------------------------------------------- General setup for adding a specific option -----------------------------------------------------------------------------
| 547 | // General setup for adding a specific option |
| 548 | //----------------------------------------------------------------------------- |
| 549 | Options::Option* Options::AddOption |
| 550 | ( |
| 551 | string const& _name |
| 552 | ) |
| 553 | { |
| 554 | if( m_locked ) |
| 555 | { |
| 556 | Log::Write( LogLevel_Error, "Options have been locked. No more may be added." ); |
| 557 | return NULL; |
| 558 | } |
| 559 | |
| 560 | // get a pointer to the option (and create a new Option if it doesn't already exist) |
| 561 | Option* option = Find( _name ); |
| 562 | if( option == NULL ) |
| 563 | { |
| 564 | option = new Option( _name ); |
| 565 | } |
| 566 | |
| 567 | return option; |
| 568 | } |
| 569 | |
| 570 | //----------------------------------------------------------------------------- |
| 571 | // <Options::Find> |