<commit_before>#ifndef _CODECSTORE_HH_
#define _CODECSTORE_HH_

#include <string>
#include <iostream>
#include "archive/ws_xml_oarchive.hpp"
#include "Exception.hh"

namespace answer{
	namespace codec{
		template<typename T>
		bool Codec ( std::ostream&, const std::string&, const T&)
		{
			return false;
		}
		
		//TODO: Move this to impl
		template<typename T>
		void GenericCodec ( std::ostream& out, const T& data)
		{
			std::cerr << "Using default codec" << std::endl;
			answer::archive::ws_xml_oarchive outA ( out );
			outA << data;
		}

		template<typename T>
		void ResponseWrapper( std::ostream& out, const std::string& response, const answer::WebMethodException*)
		{
			std::cerr << "Using default wrapper" << std::endl;
			out << response;
		}
		
	}
}

#define ANSWER_RESPONSE_WRAPPER(WrapperFunction)\
namespace answer{\
	namespace codec{\
		template<>\
		void ResponseWrapper<void>( std::ostream& out, const std::string& response, const answer::WebMethodException* ex){\<commit_msg>* Removed extraneous debug output<commit_after>#ifndef _CODECSTORE_HH_
#define _CODECSTORE_HH_

#include <string>
#include <iostream>
#include "archive/ws_xml_oarchive.hpp"
#include "Exception.hh"

namespace answer{
	namespace codec{
		template<typename T>
		bool Codec ( std::ostream&, const std::string&, const T&)
		{
			return false;
		}
		
		//TODO: Move this to impl
		template<typename T>
		void GenericCodec ( std::ostream& out, const T& data)
		{
			answer::archive::ws_xml_oarchive outA ( out );
			outA << data;
		}

		template<typename T>
		void ResponseWrapper( std::ostream& out, const std::string& response, const answer::WebMethodException*)
		{
			out << response;
		}
		
	}
}

#define ANSWER_RESPONSE_WRAPPER(WrapperFunction)\
namespace answer{\
	namespace codec{\
		template<>\
		void ResponseWrapper<void>( std::ostream& out, const std::string& response, const answer::WebMethodException* ex){\
{'fraction_non_alphanumeric': 0.1290491118077325, 'fraction_numerical': 0.0, 'mean_word_length': 4.7507507507507505, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3064580', 'n_tokens_mistral': 696, 'n_tokens_neox': 630, 'n_words': 165}