ResultWriter.h 1.48 KB
#ifndef RESULTWRITER_H
#define RESULTWRITER_H

#include "../Common/TREPSTypes.h"
#include "../XMLManager/XMLManager.h"
#include "../DataRecord/DataRecordList.h"

using namespace TREPS::Common;
using namespace TREPS::XMLManager;
using namespace TREPS::DataRecord;

namespace TREPS
{
	namespace RequestManager
	{
		class ResultWriterClass : public XMLManagerClass
		{
			public :
				ResultWriterClass(void);

				//create the root node
				bool init(void);

				//set error
				void setError(const char *msg);

				//set success
				void setSuccess(void);

				//add a string argument
				Node * addStrArg(const char *tag_name, const char *value);

				//add an integer argument
				Node * addIntArg(const char *tag_name, int value);

				//add a file info argument
				Node * addFileInfoArg(const char *tag_name, t_FileInfo info);

				//add a data record list argument
				Node * addDataRecordListArg(const char *tag_name, DataRecordListClass *data);

				//add a transformation info argument
				Node * addTransformationInfoArg(const char *tag_name, t_TransformationInfo info);
				
			private :
				//pointer to result node
				Node * getResultNode(void);

				//create an argument node
				Node * createArgNode(const char *tag_name);

				//add a vector node
				Node * addVectorsNode(Node *parent, t_VectorList *vectors);

				//add an attribute node
				Node *addAttributesNode(Node *parent, map<string,string> *attributes);
		};
	}
}

#endif