#pragma once
#include <string>
#include "TranscribableException.h"
#ifdef STARFLEETTOOLBOX_EXPORTS
#define METHODNOTSUPPOORTEDEXCPT __declspec(dllexport)
#else
#define METHODNOTSUPPOORTEDEXCPT __declspec(dllimport)
#endif
using namespace std;
/// <summary>
/// An exception used when sensor's method is not supported
/// </summary>
class METHODNOTSUPPOORTEDEXCPT MethodNotSupportedException : exception, public TranscribableException
{
public:
    /// <summary>
    /// Copy constructor
    /// </summary>
    /// <param name="message">A message pointer to a char</param>
    explicit MethodNotSupportedException(const char* message, const char* translateCode)
        : _msg(message) {
        SetTranslateCode(string(translateCode));
    }

    /// <summary>
    /// Copy constructor
    /// </summary>
    /// <param name="message">A message string</param>
    explicit MethodNotSupportedException(const string& message, string translateCode)
        : _msg(message) {
        SetTranslateCode(translateCode);
    }

    /// <summary>
    /// Destructor
    /// </summary>
    /// <returns></returns>
    virtual ~MethodNotSupportedException() noexcept {}

    /// <summary>
    /// Overload of message retrie
    /// </summary>
    /// <returns>A pointer to a char representing the message</returns>
    virtual const char* what() const noexcept {
        return _msg.c_str();
    }
protected:
    string _msg;
    string _code = "";
};

