// This code was generated by CLI, a command line interface
// compiler for C++.
//

#ifndef ODB_OPTIONS_HXX
#define ODB_OPTIONS_HXX

#include <deque>
#include <map>
#include <vector>
#include <iosfwd>
#include <string>
#include <cstddef>
#include <exception>

namespace cli
{
  class unknown_mode
  {
    public:
    enum value
    {
      skip,
      stop,
      fail
    };

    unknown_mode (value v);

    operator value () const 
    {
      return v_;
    }

    private:
    value v_;
  };

  // Exceptions.
  //

  class exception: public std::exception
  {
    public:
    virtual void
    print (std::ostream&) const = 0;
  };

  std::ostream&
  operator<< (std::ostream&, const exception&);

  class unknown_option: public exception
  {
    public:
    virtual
    ~unknown_option () throw ();

    unknown_option (const std::string& option);

    const std::string&
    option () const;

    virtual void
    print (std::ostream&) const;

    virtual const char*
    what () const throw ();

    private:
    std::string option_;
  };

  class unknown_argument: public exception
  {
    public:
    virtual
    ~unknown_argument () throw ();

    unknown_argument (const std::string& argument);

    const std::string&
    argument () const;

    virtual void
    print (std::ostream&) const;

    virtual const char*
    what () const throw ();

    private:
    std::string argument_;
  };

  class missing_value: public exception
  {
    public:
    virtual
    ~missing_value () throw ();

    missing_value (const std::string& option);

    const std::string&
    option () const;

    virtual void
    print (std::ostream&) const;

    virtual const char*
    what () const throw ();

    private:
    std::string option_;
  };

  class invalid_value: public exception
  {
    public:
    virtual
    ~invalid_value () throw ();

    invalid_value (const std::string& option,
                   const std::string& value);

    const std::string&
    option () const;

    const std::string&
    value () const;

    virtual void
    print (std::ostream&) const;

    virtual const char*
    what () const throw ();

    private:
    std::string option_;
    std::string value_;
  };

  class eos_reached: public exception
  {
    public:
    virtual void
    print (std::ostream&) const;

    virtual const char*
    what () const throw ();
  };

  class file_io_failure: public exception
  {
    public:
    virtual
    ~file_io_failure () throw ();

    file_io_failure (const std::string& file);

    const std::string&
    file () const;

    virtual void
    print (std::ostream&) const;

    virtual const char*
    what () const throw ();

    private:
    std::string file_;
  };

  class unmatched_quote: public exception
  {
    public:
    virtual
    ~unmatched_quote () throw ();

    unmatched_quote (const std::string& argument);

    const std::string&
    argument () const;

    virtual void
    print (std::ostream&) const;

    virtual const char*
    what () const throw ();

    private:
    std::string argument_;
  };

  class scanner
  {
    public:
    virtual
    ~scanner ();

    virtual bool
    more () = 0;

    virtual const char*
    peek () = 0;

    virtual const char*
    next () = 0;

    virtual void
    skip () = 0;
  };

  class argv_scanner: public scanner
  {
    public:
    argv_scanner (int& argc, char** argv, bool erase = false);
    argv_scanner (int start, int& argc, char** argv, bool erase = false);

    int
    end () const;

    virtual bool
    more ();

    virtual const char*
    peek ();

    virtual const char*
    next ();

    virtual void
    skip ();

    private:
    int i_;
    int& argc_;
    char** argv_;
    bool erase_;
  };

  class argv_file_scanner: public argv_scanner
  {
    public:
    argv_file_scanner (int& argc,
                       char** argv,
                       const std::string& option,
                       bool erase = false);

    argv_file_scanner (int start,
                       int& argc,
                       char** argv,
                       const std::string& option,
                       bool erase = false);

    struct option_info
    {
      // If search_func is not NULL, it is called, with the arg
      // value as the second argument, to locate the options file.
      // If it returns an empty string, then the file is ignored.
      //
      const char* option;
      std::string (*search_func) (const char*, void* arg);
      void* arg;
    };

    argv_file_scanner (int& argc,
                        char** argv,
                        const option_info* options,
                        std::size_t options_count,
                        bool erase = false);

    argv_file_scanner (int start,
                       int& argc,
                       char** argv,
                       const option_info* options,
                       std::size_t options_count,
                       bool erase = false);

    virtual bool
    more ();

    virtual const char*
    peek ();

    virtual const char*
    next ();

    virtual void
    skip ();

    private:
    const option_info*
    find (const char*) const;

    void
    load (const std::string& file);

    typedef argv_scanner base;

    const std::string option_;
    option_info option_info_;
    const option_info* options_;
    std::size_t options_count_;

    std::string hold_;
    std::deque<std::string> args_;
    bool skip_;
  };

  typedef std::vector<std::string> option_names;

  class option
  {
    public:

    const std::string&
    name () const;

    const option_names&
    aliases () const;

    bool
    flag () const;

    const std::string&
    default_value () const;

    public:option ();
    option (const std::string& name,
            const option_names& aliases,
            bool flag,
            const std::string& default_value);

    private:std::string name_;
    option_names aliases_;
    bool flag_;
    std::string default_value_;
  };

  class options: public std::vector<option>
  {
    public:
    typedef std::vector<option> container_type;

    container_type::const_iterator
    find (const std::string& name) const;

    void
    push_back (const option&);
    private:typedef std::map<std::string, container_type::size_type> map_type;
    map_type map_;
  };
}

#include <set>

#include <vector>

#include <string>

#include <odb/option-types.hxx>

class options
{
  public:

  options (int& argc,
           char** argv,
           bool erase = false,
           ::cli::unknown_mode option = ::cli::unknown_mode::fail,
           ::cli::unknown_mode argument = ::cli::unknown_mode::stop);

  options (int start,
           int& argc,
           char** argv,
           bool erase = false,
           ::cli::unknown_mode option = ::cli::unknown_mode::fail,
           ::cli::unknown_mode argument = ::cli::unknown_mode::stop);

  options (int& argc,
           char** argv,
           int& end,
           bool erase = false,
           ::cli::unknown_mode option = ::cli::unknown_mode::fail,
           ::cli::unknown_mode argument = ::cli::unknown_mode::stop);

  options (int start,
           int& argc,
           char** argv,
           int& end,
           bool erase = false,
           ::cli::unknown_mode option = ::cli::unknown_mode::fail,
           ::cli::unknown_mode argument = ::cli::unknown_mode::stop);

  options (::cli::scanner&,
           ::cli::unknown_mode option = ::cli::unknown_mode::fail,
           ::cli::unknown_mode argument = ::cli::unknown_mode::stop);

  // Option accessors and modifiers.
  //

  const bool&
  help () const;

  void
  help (const bool&);

  const bool&
  version () const;

  void
  version (const bool&);

  const std::vector<std::string>&
  I () const;

  void
  I (const std::vector<std::string>&);

  bool
  I_specified () const;

  void
  I_specified (bool);

  const std::vector<std::string>&
  D () const;

  void
  D (const std::vector<std::string>&);

  bool
  D_specified () const;

  void
  D_specified (bool);

  const std::vector<std::string>&
  U () const;

  void
  U (const std::vector<std::string>&);

  bool
  U_specified () const;

  void
  U_specified (bool);

  const ::database&
  database () const;

  void
  database (const ::database&);

  bool
  database_specified () const;

  void
  database_specified (bool);

  const bool&
  generate_query () const;

  void
  generate_query (const bool&);

  const bool&
  generate_schema () const;

  void
  generate_schema (const bool&);

  const std::set< ::schema_format>&
  schema_format () const;

  void
  schema_format (const std::set< ::schema_format>&);

  bool
  schema_format_specified () const;

  void
  schema_format_specified (bool);

  const std::string&
  default_schema () const;

  void
  default_schema (const std::string&);

  bool
  default_schema_specified () const;

  void
  default_schema_specified (bool);

  const std::string&
  default_pointer () const;

  void
  default_pointer (const std::string&);

  bool
  default_pointer_specified () const;

  void
  default_pointer_specified (bool);

  const std::string&
  profile () const;

  void
  profile (const std::string&);

  bool
  profile_specified () const;

  void
  profile_specified (bool);

  const std::string&
  table_prefix () const;

  void
  table_prefix (const std::string&);

  bool
  table_prefix_specified () const;

  void
  table_prefix_specified (bool);

  const std::string&
  output_dir () const;

  void
  output_dir (const std::string&);

  bool
  output_dir_specified () const;

  void
  output_dir_specified (bool);

  const std::string&
  odb_file_suffix () const;

  void
  odb_file_suffix (const std::string&);

  bool
  odb_file_suffix_specified () const;

  void
  odb_file_suffix_specified (bool);

  const std::string&
  hxx_suffix () const;

  void
  hxx_suffix (const std::string&);

  bool
  hxx_suffix_specified () const;

  void
  hxx_suffix_specified (bool);

  const std::string&
  ixx_suffix () const;

  void
  ixx_suffix (const std::string&);

  bool
  ixx_suffix_specified () const;

  void
  ixx_suffix_specified (bool);

  const std::string&
  cxx_suffix () const;

  void
  cxx_suffix (const std::string&);

  bool
  cxx_suffix_specified () const;

  void
  cxx_suffix_specified (bool);

  const std::string&
  sql_suffix () const;

  void
  sql_suffix (const std::string&);

  bool
  sql_suffix_specified () const;

  void
  sql_suffix_specified (bool);

  const std::vector<std::string>&
  hxx_prologue () const;

  void
  hxx_prologue (const std::vector<std::string>&);

  bool
  hxx_prologue_specified () const;

  void
  hxx_prologue_specified (bool);

  const std::vector<std::string>&
  ixx_prologue () const;

  void
  ixx_prologue (const std::vector<std::string>&);

  bool
  ixx_prologue_specified () const;

  void
  ixx_prologue_specified (bool);

  const std::vector<std::string>&
  cxx_prologue () const;

  void
  cxx_prologue (const std::vector<std::string>&);

  bool
  cxx_prologue_specified () const;

  void
  cxx_prologue_specified (bool);

  const std::vector<std::string>&
  sql_prologue () const;

  void
  sql_prologue (const std::vector<std::string>&);

  bool
  sql_prologue_specified () const;

  void
  sql_prologue_specified (bool);

  const std::vector<std::string>&
  hxx_epilogue () const;

  void
  hxx_epilogue (const std::vector<std::string>&);

  bool
  hxx_epilogue_specified () const;

  void
  hxx_epilogue_specified (bool);

  const std::vector<std::string>&
  ixx_epilogue () const;

  void
  ixx_epilogue (const std::vector<std::string>&);

  bool
  ixx_epilogue_specified () const;

  void
  ixx_epilogue_specified (bool);

  const std::vector<std::string>&
  cxx_epilogue () const;

  void
  cxx_epilogue (const std::vector<std::string>&);

  bool
  cxx_epilogue_specified () const;

  void
  cxx_epilogue_specified (bool);

  const std::vector<std::string>&
  sql_epilogue () const;

  void
  sql_epilogue (const std::vector<std::string>&);

  bool
  sql_epilogue_specified () const;

  void
  sql_epilogue_specified (bool);

  const std::string&
  hxx_prologue_file () const;

  void
  hxx_prologue_file (const std::string&);

  bool
  hxx_prologue_file_specified () const;

  void
  hxx_prologue_file_specified (bool);

  const std::string&
  ixx_prologue_file () const;

  void
  ixx_prologue_file (const std::string&);

  bool
  ixx_prologue_file_specified () const;

  void
  ixx_prologue_file_specified (bool);

  const std::string&
  cxx_prologue_file () const;

  void
  cxx_prologue_file (const std::string&);

  bool
  cxx_prologue_file_specified () const;

  void
  cxx_prologue_file_specified (bool);

  const std::string&
  sql_prologue_file () const;

  void
  sql_prologue_file (const std::string&);

  bool
  sql_prologue_file_specified () const;

  void
  sql_prologue_file_specified (bool);

  const std::string&
  hxx_epilogue_file () const;

  void
  hxx_epilogue_file (const std::string&);

  bool
  hxx_epilogue_file_specified () const;

  void
  hxx_epilogue_file_specified (bool);

  const std::string&
  ixx_epilogue_file () const;

  void
  ixx_epilogue_file (const std::string&);

  bool
  ixx_epilogue_file_specified () const;

  void
  ixx_epilogue_file_specified (bool);

  const std::string&
  cxx_epilogue_file () const;

  void
  cxx_epilogue_file (const std::string&);

  bool
  cxx_epilogue_file_specified () const;

  void
  cxx_epilogue_file_specified (bool);

  const std::string&
  sql_epilogue_file () const;

  void
  sql_epilogue_file (const std::string&);

  bool
  sql_epilogue_file_specified () const;

  void
  sql_epilogue_file_specified (bool);

  const std::vector<std::string>&
  odb_prologue () const;

  void
  odb_prologue (const std::vector<std::string>&);

  bool
  odb_prologue_specified () const;

  void
  odb_prologue_specified (bool);

  const std::vector<std::string>&
  odb_prologue_file () const;

  void
  odb_prologue_file (const std::vector<std::string>&);

  bool
  odb_prologue_file_specified () const;

  void
  odb_prologue_file_specified (bool);

  const std::vector<std::string>&
  odb_epilogue () const;

  void
  odb_epilogue (const std::vector<std::string>&);

  bool
  odb_epilogue_specified () const;

  void
  odb_epilogue_specified (bool);

  const std::vector<std::string>&
  odb_epilogue_file () const;

  void
  odb_epilogue_file (const std::vector<std::string>&);

  bool
  odb_epilogue_file_specified () const;

  void
  odb_epilogue_file_specified (bool);

  const bool&
  include_with_brackets () const;

  void
  include_with_brackets (const bool&);

  const std::string&
  include_prefix () const;

  void
  include_prefix (const std::string&);

  bool
  include_prefix_specified () const;

  void
  include_prefix_specified (bool);

  const std::vector<std::string>&
  include_regex () const;

  void
  include_regex (const std::vector<std::string>&);

  bool
  include_regex_specified () const;

  void
  include_regex_specified (bool);

  const bool&
  include_regex_trace () const;

  void
  include_regex_trace (const bool&);

  const std::string&
  guard_prefix () const;

  void
  guard_prefix (const std::string&);

  bool
  guard_prefix_specified () const;

  void
  guard_prefix_specified (bool);

  const std::string&
  options_file () const;

  void
  options_file (const std::string&);

  bool
  options_file_specified () const;

  void
  options_file_specified (bool);

  const std::vector<std::string>&
  x () const;

  void
  x (const std::vector<std::string>&);

  bool
  x_specified () const;

  void
  x_specified (bool);

  const bool&
  v () const;

  void
  v (const bool&);

  const bool&
  trace () const;

  void
  trace (const bool&);

  const std::string&
  mysql_engine () const;

  void
  mysql_engine (const std::string&);

  bool
  mysql_engine_specified () const;

  void
  mysql_engine_specified (bool);

  const bool&
  sqlite_lax_auto_id () const;

  void
  sqlite_lax_auto_id (const bool&);

  // Print usage information.
  //
  static void
  print_usage (::std::ostream&);

  // Option description.
  //
  static const ::cli::options&
  description ();

  private:
  void
  _parse (::cli::scanner&,
          ::cli::unknown_mode option,
          ::cli::unknown_mode argument);

  public:
  bool help_;
  bool version_;
  std::vector<std::string> I_;
  bool I_specified_;
  std::vector<std::string> D_;
  bool D_specified_;
  std::vector<std::string> U_;
  bool U_specified_;
  ::database database_;
  bool database_specified_;
  bool generate_query_;
  bool generate_schema_;
  std::set< ::schema_format> schema_format_;
  bool schema_format_specified_;
  std::string default_schema_;
  bool default_schema_specified_;
  std::string default_pointer_;
  bool default_pointer_specified_;
  std::string profile_;
  bool profile_specified_;
  std::string table_prefix_;
  bool table_prefix_specified_;
  std::string output_dir_;
  bool output_dir_specified_;
  std::string odb_file_suffix_;
  bool odb_file_suffix_specified_;
  std::string hxx_suffix_;
  bool hxx_suffix_specified_;
  std::string ixx_suffix_;
  bool ixx_suffix_specified_;
  std::string cxx_suffix_;
  bool cxx_suffix_specified_;
  std::string sql_suffix_;
  bool sql_suffix_specified_;
  std::vector<std::string> hxx_prologue_;
  bool hxx_prologue_specified_;
  std::vector<std::string> ixx_prologue_;
  bool ixx_prologue_specified_;
  std::vector<std::string> cxx_prologue_;
  bool cxx_prologue_specified_;
  std::vector<std::string> sql_prologue_;
  bool sql_prologue_specified_;
  std::vector<std::string> hxx_epilogue_;
  bool hxx_epilogue_specified_;
  std::vector<std::string> ixx_epilogue_;
  bool ixx_epilogue_specified_;
  std::vector<std::string> cxx_epilogue_;
  bool cxx_epilogue_specified_;
  std::vector<std::string> sql_epilogue_;
  bool sql_epilogue_specified_;
  std::string hxx_prologue_file_;
  bool hxx_prologue_file_specified_;
  std::string ixx_prologue_file_;
  bool ixx_prologue_file_specified_;
  std::string cxx_prologue_file_;
  bool cxx_prologue_file_specified_;
  std::string sql_prologue_file_;
  bool sql_prologue_file_specified_;
  std::string hxx_epilogue_file_;
  bool hxx_epilogue_file_specified_;
  std::string ixx_epilogue_file_;
  bool ixx_epilogue_file_specified_;
  std::string cxx_epilogue_file_;
  bool cxx_epilogue_file_specified_;
  std::string sql_epilogue_file_;
  bool sql_epilogue_file_specified_;
  std::vector<std::string> odb_prologue_;
  bool odb_prologue_specified_;
  std::vector<std::string> odb_prologue_file_;
  bool odb_prologue_file_specified_;
  std::vector<std::string> odb_epilogue_;
  bool odb_epilogue_specified_;
  std::vector<std::string> odb_epilogue_file_;
  bool odb_epilogue_file_specified_;
  bool include_with_brackets_;
  std::string include_prefix_;
  bool include_prefix_specified_;
  std::vector<std::string> include_regex_;
  bool include_regex_specified_;
  bool include_regex_trace_;
  std::string guard_prefix_;
  bool guard_prefix_specified_;
  std::string options_file_;
  bool options_file_specified_;
  std::vector<std::string> x_;
  bool x_specified_;
  bool v_;
  bool trace_;
  std::string mysql_engine_;
  bool mysql_engine_specified_;
  bool sqlite_lax_auto_id_;
};

#include <odb/options.ixx>

#endif // ODB_OPTIONS_HXX
