advgetopt/conf_file.cpp
/** \brief Erase the named parameter from this configuration file.
 *
 * This function can be used to remove the specified parameter from
 * this configuration file.
 *
 * If that parameter is not defined in the file, then nothing happens.
 *
 * \param[in] name  The name of the parameter to remove.
 *
 * \return true if the parameter was removed, false if it did not exist.
 */
\brief Erase the named parameter from this configuration file.
This function can be used to remove the specified parameter from
this configuration file.

If that parameter is not defined in the file, then nothing happens.

\param[in] name  The name of the parameter to remove.

\return true if the parameter was removed, false if it did not exist.
\ brief Erase the named parameter from this configuration file . This function can be used to remove the specified parameter from this configuration file . If that parameter is not defined in the file then nothing happens . \ param [ in ] name The name of the parameter to remove . \ return true if the parameter was removed false if it did not exist .
bool conf_file::erase_parameter(std::string name)
{
    std::replace(name.begin(), name.end(), '_', '-');
    auto it(f_parameters.find(name));
    if(it == f_parameters.end())
    {
        return false;
    }
    f_parameters.erase(it);
    if(!f_reading)
    {
        f_modified = true;
        value_changed(callback_action_t::erased, name, std::string());
    }
    return true;
}
bool conf_file :: erase_parameter ( std :: string name ) { std :: replace ( name . begin ( ) , name . end ( ) , ' ' , ' ' ) ; auto it ( f_parameters . find ( name ) ) ; if ( it == f_parameters . end ( ) ) { return false ; } f_parameters . erase ( it ) ; if ( ! f_reading ) { f_modified = true ; value_changed ( callback_action_t :: erased , name , std :: string ( ) ) ; } return true ; }
\brief Erase the named parameter from this configuration file.
\ brief Erase the named parameter from this configuration file .