RequestFormatsGet.cpp 1.34 KB
#include "RequestFormatsGet.h"

#include "../File/FileFormatManager.h"

using namespace TREPS::File;

namespace TREPS
{
	namespace RequestManager
	{
		RequestFormatsGetClass::RequestFormatsGetClass(void):RequestAbstractClass()
		{
			this->outputType = OUTPUT_XMLFILE;
		}

		RequestFormatsGetClass::~RequestFormatsGetClass(void)
		{
		}

		string RequestFormatsGetClass::getRequestId(void)
                {
                        return "formats_get";
                }

		bool RequestFormatsGetClass::load(RequestLoaderClass *loader)
		{
			//nothing to do
			return true;
		}

		bool RequestFormatsGetClass::run(void)
		{
			string formatsFile = this->app->getConf()->getFormatsFilePath();

			if (formatsFile.compare("") == 0)
				return false;

			//init file format manager
			FileFormatManagerClass *formatMgr = new FileFormatManagerClass();

			//file validation
			bool fileOK = formatMgr->init(formatsFile.c_str());

			delete formatMgr;

			return fileOK;
		}
		
		void RequestFormatsGetClass::writeResult(ResultWriterClass *writer)
		{
			//No result file for this request
		}

		string RequestFormatsGetClass::getResultFileSuffix(void)
		{
			return "";
		}

		string RequestFormatsGetClass::getXMLFilePath(void)
		{
			return this->app->getConf()->getFormatsFilePath();
		}

		string RequestFormatsGetClass::getStringResult(void)
		{
			return "";
		}
	}
}