FileWriterBodies.h 1.08 KB
#ifndef FILEWRITERBODIES_H
#define FILEWRITERBODIES_H

//#define TREPS_VOTABLE_XSD "votable-V1.2.xsd"

//#include "FileWriterAbstract.h"
//#include <stdio.h>
//#include <stdlib.h>
#include "../XMLManager/XMLManager.h"
#include "../../CDPP3DViewSOAPClient/cdpp3dviewcdppBinderProxy.h"

using namespace TREPS::XMLManager;

namespace TREPS
{
	namespace File
	{
		//declare stype as in Bodies/BodiesCDPP3DView.h
		typedef vector<ns4__Body*> t_Bodies;
		
		class FileWriterBodiesClass
		{
			public :
				FileWriterBodiesClass(void);

				~FileWriterBodiesClass(void);

				//create XML file and add general attributes
				bool init(const char *file_path, const map<string,string> *attributes);

				//write bodies in xml file
				bool writeData(const t_Bodies *bodies);

				//save the XML file
				bool save(void);

				//close the xml file
				bool close(void);

				//test if a file is opened
				bool isOpened(void);

			protected :
				ApplicationClass *app;

			private :
				//path to the initialized file
				string filePath;

				//pointer to the xml writer
				XMLManagerClass *writer;

		};
	}
}

#endif