/******************************************************************************
 GMScanner.h

	Interface for the GMScanner class.

	Copyright © 1997 by Glenn W. Bach.  All rights reserved.
	
	Base code generated by Codemill v0.1.0

 *****************************************************************************/

#ifndef _H_GMScanner
#define _H_GMScanner

#include <JString.h>

class istream;

enum ScanState
{
	kHeaderStart = 258,
	kHeaderEnd,
	kFrom,
	kSubject,
	kDate,
	kCC,
	kReplyTo,
	kStatus
};

class GMScanner 
{
public:

	GMScanner(istream* is);
	virtual ~GMScanner();

	int 		yylex();
	int 		GetCurrentHeaderStart();
	int 		GetCurrentPosition();

	const JString& YYText();

private:

	istream*	itsIs;
	ScanState	itsState;
	int			itsCurrentHeaderStart;
	int			itsCurrentPosition;
	JString		itsText;

private:

	// not allowed

	GMScanner(const GMScanner& source);
	const GMScanner& operator=(const GMScanner& source);
};

/******************************************************************************
 YYText

 *****************************************************************************/

inline const JString&
GMScanner::YYText()
{
	return itsText;
}

/******************************************************************************
 GetCurrentHeaderStart

 *****************************************************************************/

inline int
GMScanner::GetCurrentHeaderStart()
{
	return itsCurrentHeaderStart;
}

/******************************************************************************
 GetCurrentPosition

 *****************************************************************************/

inline int
GMScanner::GetCurrentPosition()
{
	return itsCurrentPosition;
}

#endif
