//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      App/AppOptions.h
//! @brief     Collection of utilities to parse command line options
//!
//! @homepage  http://www.bornagainproject.org
//! @license   GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
//  ************************************************************************************************

#ifndef BORNAGAIN_APP_APPOPTIONS_H
#define BORNAGAIN_APP_APPOPTIONS_H

#include <QSize>
#include <QString>
#include <boost/program_options/options_description.hpp>
#include <boost/program_options/positional_options.hpp>
#include <boost/program_options/variables_map.hpp>
#include <string>

namespace bpo = boost::program_options;

//! Handles command line and config file program options

class ApplicationOptions {
public:
    ApplicationOptions(int argc = 0, char** argv = 0);

    QSize mainWindowSize() const;

    QString projectFile() const;

    //! Returns true if option with given name has been set
    bool find(std::string name) const;

private:
    //! Parses command line arguments
    void parseCommandLine(int argc, char** argv);

    void processOptions();

    //! options description, to be filled with add() from different program modules
    bpo::options_description m_options;
    //! positional options description, to be filled with addPositional() from main module
    bpo::positional_options_description m_positional_options;
    bpo::variables_map m_variables_map; //! parsed variables
};

#endif // BORNAGAIN_APP_APPOPTIONS_H
