/***************************************************************************
                          MELError.cpp  -  description
                             -------------------
    begin                : Mon Feb 21 2005
    copyright            : (C) 2005 by klaus frieler
    email                : kgf@omniversum.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "MelError.h"

string   MelError::getErrTextFromCode(const MRESULT mr)
{
   string errText;
   switch(mr)
   {
      case ERR_UNEXPECTED:
         errText = "Something unexpected.";
      break;   

      case ERR_FAIL : 
         errText = "General failure.";
         break;
      case ERR_INVALIDARG: 
         errText = "Invalid argument";
         break;
      case ERR_NOPOINTER: 
         errText = "No pointer.";
         break;
      case ERR_OUTOFMEMORY: 
         errText = "Out of memory.";
         break;
      case ERR_EMPTY: 
         errText = "Empty vector or list.";
         break;
      case ERR_INCOMPATIBLE: 
         errText = "Incompatible data.";
         break;
      case ERR_FILE_OPEN: 
         errText = "Could not open file.";
         break;
      case ERR_FILE_FORMAT: 
         errText = "Bad file format.";
         break;
      case ERR_FILE_READ: 
         errText = "I/O error during read.";
         break;
      case ERR_FILE_WRITE: 
         errText = "I/O error during write.";
         break;
      case ERR_DATA_MISSING: 
         errText = "Data is missing.";
         break;
      case ERR_BAD_DATA: 
         errText = "Bad data.";
         break;
      case ERR_BAD_OBJECT: 
         errText = "Bad object.";
         break;
      default:
         errText = "Unknown error.";
      break;   
   }
   return errText;
}
string   MelError::getErrText()
{
   return MelError::getErrTextFromCode(m_mr);

}