/*
 * File:   XMLParser.h
 * Author: blackpanther
 *
 * Created on November 22, 2010, 2:03 PM
 */

#ifndef XMLPARSER_H
#define	XMLPARSER_H

#include "problema.h"
#include "group.h"
#include "user.h"
#include "result.h"

/** Parsers which take a filepath as argument and return corresponding structure */
Problema*    parseProblemFromFile(const char* xmlfilepath);
Group*       parseGroupFromFile  (const char* xmlfilepath);
ResultArray* parseResultFromFile (const char* xmlfilepath);
User*        parseUserFromFile   (const char* xmlfilepath);

/** Parsers which take a xml string as argument and return corresponding structure */
Problema*    parseProblemFromString(const char* xml);
Group*       parseGroupFromString  (const char* xml);
ResultArray* parseResultFromString (const char* xml);
User*        parseUserFromString   (const char* xml);

/** Specific parser which extract a vector from xml */
double*          parseVectorFromString     (const char* xml);
/** Specific parser which extract parameters from xml */
MethodParameters parseConditionsFromString (const char* xml);

/** Parsers which can write XML representation of given structure */
char*        writeProblemXML(Problema *);
char*        writeGroupXML(Group *);
char*        writeUserXML(User *);
char*        writeResultXML(ResultArray *results);

#endif	/* XMLPARSER_H */

