#ifndef __ofXMLSettings__
#define __ofXMLSettings__

#include "ofConstants.h"
#include <string.h>
#include "tinyxml.h"

using namespace std;



#define MAX_TAG_VALUE_LENGTH_IN_CHARS		1024

class ofXmlSettings {

	public:
		ofXmlSettings();
		
		void setVerbose(bool _verbose);				
		
		bool loadFile(string xmlFile);
		void saveFile(string  xmlFile);
		
		// 	not done yet
		//	void clearTagContents(string tag);
		//	void removeTag(string  tag);
		
		void	clear();	// removes all tags from the ofXMLSettings object

		int 	getValue(string  tag, int  	 	defaultValue, int which = 0);
		float 	getValue(string  tag, double  	defaultValue, int which = 0);
		string 	getValue(string  tag, string 	defaultValue, int which = 0);
		
		bool	getSuccess();

		void	setValue(string  tag, int    	value);
		void 	setValue(string  tag, double  	value);
		void 	setValue(string  tag, string 	value);

		
		TiXmlDocument 	doc;
		bool 			bDocLoaded;
		
	protected:
	
		bool	tagExists;	
		void 	addTag(string  tag, char * valueString);
		bool 	readTag(string  tag, char * valueString, int which = 0);	// max 1024 chars...
		
		
};

#endif
