[muparser] Remove ParserErrorMsg

This was a class to "manage" error messages. Remove it and replace
it with a function.
This commit is contained in:
ridiculousfish
2017-11-18 16:03:26 -08:00
parent cad9bbd2a2
commit 5f7f1102db
2 changed files with 91 additions and 133 deletions

View File

@@ -94,26 +94,8 @@ enum EErrorCodes {
ecUNDEFINED = -1 ///< Undefined message, placeholder to detect unassigned error messages
};
//---------------------------------------------------------------------------
/** \brief A class that handles the error messages.
*/
class ParserErrorMsg {
public:
typedef ParserErrorMsg self_type;
ParserErrorMsg &operator=(const ParserErrorMsg &);
ParserErrorMsg(const ParserErrorMsg &);
ParserErrorMsg();
~ParserErrorMsg();
static const ParserErrorMsg &Instance();
string_type operator[](unsigned a_iIdx) const;
private:
std::vector<string_type> m_vErrMsg; ///< A vector with the predefined error messages
static const self_type m_Instance; ///< The instance pointer
};
/// \return an error message for the given code.
string_type parser_error_for_code(EErrorCodes code);
//---------------------------------------------------------------------------
/** \brief Error class of the parser.
@@ -153,7 +135,6 @@ class ParserError {
string_type m_strTok; ///< Token related with the error
int m_iPos; ///< Formula position related to the error
EErrorCodes m_iErrc; ///< Error code
const ParserErrorMsg &m_ErrMsg;
};
} // namespace mu