| Home | Libraries | People | FAQ | More

## Class invalid_syntax

boost::program_options::invalid_syntax

## Synopsis

    // In header: <boost/program_options/errors.hpp>

    class invalid_syntax : public boost::program_options::error_with_option_name {
    public:

      enum kind_t { long_not_allowed = = 30, long_adjacent_not_allowed,
                    short_adjacent_not_allowed, empty_adjacent_parameter,
                    missing_parameter, extra_parameter, unrecognized_line };
      // construct/copy/destruct
      invalid_syntax(kind_t, const std::string & = "", const std::string & = "",
                     int = 0);
      ~invalid_syntax();

      // public member functions
      kind_t kind() const;
      virtual std::string tokens() const;

      // protected member functions
      std::string get_template(kind_t);
    };

## Description

Class thrown when there's syntax error either for command line or config file options. See derived children for concrete classes.

### `invalid_syntax` public construct/copy/destruct

1.     invalid_syntax(kind_t kind, const std::string & option_name = "",
                      const std::string & original_token = "", int option_style = 0);

2.     ~invalid_syntax();

### `invalid_syntax` public member functions

1.     kind_t kind() const;

2.     virtual std::string tokens() const;

   Convenience functions for backwards compatibility

### `invalid_syntax` protected member functions

1.     std::string get_template(kind_t kind);

   Used to convert kind_t to a related error text