/******************************************************************************
 JCurveInfo.cc

	Copyright @ 1998 by Glenn W. Bach. All rights reserved.

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

#include <JCurveInfo.h>
#include <JString.h>
#include <jAssert.h>

const JFileVersion kCurrentSetupVersion = 0;

/******************************************************************************
 Stream operators for JCurveInfo

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

istream&
operator>>
	(
	istream&	input,
	JCurveInfo&	info
	)
{
	JFileVersion vers;
	input >> vers;
	assert( vers <= kCurrentSetupVersion );
	input >> info.curve >> info.lines >> info.symbols >> info.points;
	input >> info.own >> info.xerrors >> info.yerrors >> info.protect;
	input >> info.color >> info.symbol >> *(info.name);
	return input;
}

ostream&
operator<<
	(
	ostream&			output,
	const JCurveInfo&	info
	)
{
	output << kCurrentSetupVersion;
	output << ' ' << info.curve;
	output << ' ' << info.lines;
	output << ' ' << info.symbols;
	output << ' ' << info.points;
	output << ' ' << info.own;
	output << ' ' << info.xerrors;
	output << ' ' << info.yerrors;
	output << ' ' << info.protect;
	output << ' ' << info.color;
	output << ' ' << info.symbol;
	output << ' ' << *(info.name);
	return output;
}

/******************************************************************************
 Stream functions for JSymbolType

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

istream&
operator>>
	(
	istream&		input,
	JSymbolType&	type
	)
{
	long temp;
	input >> temp;
	type = (JSymbolType) temp;
	assert( 0 <= type && type < kSymbolCount );
	return input;
}

ostream&
operator<<
	(
	ostream&			output,
	const JSymbolType	type
	)
{
	output << (long) type;
	return output;
}
