/*
 * Author:
 *         Kendy Kutzner <kutzner@ira.uka.de>
 *
 * (c) 2005 Research Group Dr. Fuhrmann, University of Karlsruhe, Germany
 * All rights reserved.
 *
 * $Id: rawmessage.h,v 1.5 2006/01/05 10:24:27 kutzner Exp $
 *
 */

#ifndef _RAWMESSAGE_H_
#define _RAWMESSAGE_H_

#include <string>
#include <map>
using namespace std;

#include "buf.h"

class rawmessage{
	public:
		rawmessage(){_vals.clear(), _bindata.clear(); _complete = false;};

		void parse(buf *b);
		void unparse(buf *b);

		string getval(string a);
		int getint(string a);
		bool getbool(string a);
		double getdouble(string a);
		void addval(string a, string v);
		void addval(string a, int v);
		void addvalb(string a, bool v);
		void addvald(string a, double v);

		void getbin(buf*b); // add data from rawmsg to b
		void putbin(buf*b); // add data from b to rawmsg

		bool complete(){return _complete;};
		

	private:
		map<string,string> _vals;
		buf _bindata;
		bool _complete;

		static const string contentlengthstring;
		static const string truestring;
		static const string falsestring;


};


#endif
