Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

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 };

  // public member functions
  invalid_syntax(kind_t, const std::string & = "", const std::string & = "", 
                 int = 0);
  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 member functions

  1. invalid_syntax(kind_t kind, const std::string & option_name = "", 
                   const std::string & original_token = "", int option_style = 0);
  2. kind_t kind() const;
  3. 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


PrevUpHomeNext