Retrieve data from a database and return them as options.
The purpose of this function is basically to connect to the database, and retrieve all the options entries from the 'Configuration' table.
- Parameters
-
database | The URL of the database from which the configuration data is retrieved. It should be given in the form
- [user[:password]@]server.com[:port]/database
with
- user: user name (default is the current user)
- password: necessary if required by the database rights
- server: the URL of the server (can be 'localhost')
- port: the port to which to connect (usually obsolete)
- database: The name of the database containing the table
|
desc | A reference to the object with the description of the options which should be retrieved. |
allow_unregistered | If this is true also unregistered, i.e. options unknown to desc, are returned. Otherwise an exception is thrown if such an option was retrieved. |
- Returns
- Return an object of type basic_parsed_options containing all the entries retrieved from the database. Options not found in desc are flagged as unregistered.
- Exceptions
-
Two | types of exceptions are thrown
- It thows an unnamed exception if the options could not be retrieved properly from the databse.
- If an option is not registered within the given descriptions and allow_unregistered is false, an exception of type po::unknown_option is thrown.
|
- Todo:
- The exceptions handling should be improved.
- The final database layout is missing in the description
- Shell we allow options to be given more than once?
Definition at line 451 of file Configuration.cc.
Referenced by Parse(), and ~Configuration().
453 return po::parsed_options(&desc);