#ifndef __cmt_error_h__
#define __cmt_error_h__

#include "cmt_std.h"
#include "cmt_string.h"

class CmtError
{
public:

  typedef enum
  {
    ok,
    syntax_error,
    command_not_implemented,
    package_not_found,
    version_conflict,
    file_access_error,
    execution_error,
	cannot_lock,
	cannot_write_lock,
	cannot_run_lock_command,
	cannot_unlock,
	cannot_run_unlock_command,
	cannot_remove_lock,
	conflicting_lock
  } code;

  static void clear ();
  static code get_last_error_code ();
  static bool has_pending_error ();
  static const cmt_string& get_error_name (code error);
  static void set (code error, const cmt_string& text);
  static void print ();
};

#endif
