// morse.h - Static class for converting chracter to Morse code and viceversa.

#ifndef _MORSE_H_
#define _MORSE_H_

#include <cctype>

class Morse {
public:
  static const int NMCODES = 40; // Number of Morse code characters
  static int ismorse(char c) {return (isalnum(c) || c=='.' || c==',' || c==';' || c==':');}
  static const char * char2morse(char c); // Given a character, return its Morse code, if defined,
					  // otherwise return ""
  static char morse2char(const char * s); // Given a Morse code, returns the corresponding character
private:
   //Table of Morse codes associated to characters starting at ' '
   static const char charm[95][7];
   static const char mc[128];
};

#endif

