xlnt - community edition
Public Member Functions | List of all members
xlnt::unhandled_switch_case Class Reference

Debug exception for a switch that fell through to the default case More...

#include <exceptions.hpp>

Inheritance diagram for xlnt::unhandled_switch_case:
xlnt::exception

Public Member Functions

 unhandled_switch_case (long long switch_value)
 Constructor taking a switch value. Useful for: More...
 
 unhandled_switch_case (const std::string &switch_value_string)
 Constructor taking a switch value as a string. More...
 
 unhandled_switch_case (const char *switch_value_optional_string=nullptr)
 Constructor taking a switch value as an optional string. This constructor with an optional message is unfortunately necessary to avoid complexity in default_case. If possible, please always provide a switch value (either as a value or as a string) instead of leaving it empty! More...
 
- Public Member Functions inherited from xlnt::exception
 exception (const std::string &message)
 Constructs an exception with a message. This message will be returned by std::exception::what(), an inherited member of this class. More...
 
void message (const std::string &message)
 Sets the message after the xlnt::exception is constructed. This can show more specific information than std::exception::what(). More...
 
const std::string & message ()
 Gets the message containing extra information. More...
 

Detailed Description

Debug exception for a switch that fell through to the default case

Constructor & Destructor Documentation

◆ unhandled_switch_case() [1/3]

xlnt::unhandled_switch_case::unhandled_switch_case ( long long  switch_value)
explicit

Constructor taking a switch value. Useful for:

  • integer types
  • enums (but rather for handling default switch cases; otherwise for handling single cases use the string overloads below)

◆ unhandled_switch_case() [2/3]

xlnt::unhandled_switch_case::unhandled_switch_case ( const std::string &  switch_value_string)
explicit

Constructor taking a switch value as a string.

◆ unhandled_switch_case() [3/3]

xlnt::unhandled_switch_case::unhandled_switch_case ( const char *  switch_value_optional_string = nullptr)
explicit

Constructor taking a switch value as an optional string. This constructor with an optional message is unfortunately necessary to avoid complexity in default_case. If possible, please always provide a switch value (either as a value or as a string) instead of leaving it empty!


The documentation for this class was generated from the following file: