#ifndef SCRIPTREADER_H
#define SCRIPTREADER_H

class TextUI;

/** \ingroup utility
* \brief Reads and processes a script file that runs robot commands in batch.
*
* This class is really only one function.  When called, processScript() will
* read the given script file (which contains robot commands) and sends the
* contents one line at a time to the parent TextUI object to simulate a user
* entering commands.  The processScript() call returns only when the script is
* finished.
*/

class ScriptReader {
public:

  /**
  * \brief Constructs this object with a reference to the TextUI object.
  *
  * \param textUI A reference to the parent TextUI object.
  */
  ScriptReader( TextUI * textUI );

  /**
  * \brief Processes the given script and returns when the script is done.
  *
  * Reads the contents of the script file \a filename one line at a time and
  * sends the command to the TextUI object to simulate a user entering
  * commands.  Note that the commands are sent immediately one after
  * another.  To specify a waiting period between commands, use the special
  * script command <tt>wait \<time></tt> where \c time specifies the waiting
  * period in milliseconds.
  *
  * \param filename The script file to read commands from.
  */
  void processScript( char * filename );

private:
  TextUI * textUI;
};

#endif
