2 * File: OptionContext.h
4 * Copyright (c) Freescale Semiconductor, Inc. All rights reserved.
5 * See included license file for license details.
7 #if !defined(_OptionContext_h_)
8 #define _OptionContext_h_
17 * \brief Pure abstract interface class to a table of options.
22 //! \brief Detemine whether the named option is present in the table.
23 //! \param name The name of the option to query.
24 //! \retval true The option is present and has a value.
25 //! \retval false No option with that name is in the table.
26 virtual bool hasOption(const std::string & name) const=0;
28 //! \brief Returns the option's value.
29 //! \param name The name of the option.
30 //! \return The value for the option named \a name.
31 //! \retval NULL No option is in the table with that name.
32 virtual const Value * getOption(const std::string & name) const=0;
34 //! \brief Adds or changes an option's value.
36 //! If the option was not already present in the table, it is added.
37 //! Otherwise the old value is replaced.
39 //! \param name The option's name.
40 //! \param value New value for the option.
41 virtual void setOption(const std::string & name, Value * value)=0;
43 //! \brief Removes an option from the table.
44 //! \param name The name of the option to remove.
45 virtual void deleteOption(const std::string & name)=0;
48 }; // namespace elftosb
50 #endif // _OptionContext_h_