//---------------------------------------------------------------------------
/*
(c) Oleg V. Dolomanov 2002-3
This source code is provided without warranty of any kind.
The author is not responsible for losses of information or any other 
damage caused by this code. You use it on your own risk. You can distribute, 
modify and incorporate this code into any non-commercial packages without 
author's permission. Acknowledgements are not necessary, but would be 
appreciated.
*/
/*
This class encapsulates basic CIF file. It provides functions for quick 
data modification and extraction. Loops are not supported, although they 
are correctly imported and exported. 
*/
#ifndef cifH
#define cifH
struct TCifData
{
	TStringList *Data;
	bool String;
};
class TCif
{
private:
	TStringList *Lines, *FParameters;
	void _fastcall Format();
	AnsiString FDataName, FWeightA, FWeightB;
public:
	TCif();
	~TCif();
	void _fastcall Clear();
	void _fastcall LoadFromFile(AnsiString FileName);
	void _fastcall SaveToFile(AnsiString FileName);
	bool _fastcall GetParameter(AnsiString Param, TCifData *Params);
	bool _fastcall GetParameter(AnsiString Param, double &Val);
	bool _fastcall GetParameter(AnsiString Param, AnsiString &Params);
	bool _fastcall SetParameter(AnsiString Param, TCifData *Params);
	__property TStringList *Parameters 	= {read = FParameters};
	__property AnsiString DataName 		= {read = FDataName};
	__property AnsiString WeightA 		= {read = FWeightA};
	__property AnsiString WeightB 		= {read = FWeightB};
};
void _fastcall FormatString(AnsiString &T);
void _fastcall FormatString(AnsiString &S, int count, bool Right, char Char);
//---------------------------------------------------------------------------
#endif
 
