<commit_before>#pragma once
#include <string>
#include <vector>
#include <boost/regex.hpp>
#include <boost/signals2.hpp>
#include <boost/algorithm/string.hpp>

namespace net {

namespace http {

/**
 * Represents a single header in a request or ressponse
 */
class header : std::pair<std::string, std::string> {
public:
	header(
		const std::string &k,
		const std::string &v
	):std::pair<std::string, std::string>{
		normalize_key(k),
		normalize_value(v)
	  }
	{
	}

	std::string to_string() const { return first + ": " + second; }
	const std::string &key() const { return first; }
	const std::string &value() const { return second; }

	static std::string
	normalize_key(const std::string &k)
	{
		// s/(?:^|-)([^-]*)/\U$1\L$2/g
		return boost::regex_replace(
			k,
			boost::regex("(?:^|-)\\K([^-]+)"),
			"\\L\\u\\1",
			boost::match_default | boost::format_all
		);
	}

	static std::string
	normalize_value(const std::string &v)
	{
		return v;
	}

	bool matches(const std::string &k) const { return normalize_key(k) == first; }
};

/**
 * Base class used by HTTP requests and responses.
 */
class message {
public:
	/**
	 * Move constructor.
	 * Note that this does not apply any existing
	 * signal handlers. I think that's probably a bug.
	 */
	message(
		message &&src
	):version_(std::move(src.version_)),
	  headers_(std::move(src.headers_))
	{
	}

	void<commit_msg>Ensure ctor/dtors are available<commit_after>#pragma once
#include <string>
#include <vector>
#include <boost/regex.hpp>
#include <boost/signals2.hpp>
#include <boost/algorithm/string.hpp>

namespace net {

namespace http {

/**
 * Represents a single header in a request or ressponse
 */
class header : std::pair<std::string, std::string> {
public:
	header(
		const std::string &k,
		const std::string &v
	):std::pair<std::string, std::string>{
		normalize_key(k),
		normalize_value(v)
	  }
	{
	}

	std::string to_string() const { return first + ": " + second; }
	const std::string &key() const { return first; }
	const std::string &value() const { return second; }

	static std::string
	normalize_key(const std::string &k)
	{
		// s/(?:^|-)([^-]*)/\U$1\L$2/g
		return boost::regex_replace(
			k,
			boost::regex("(?:^|-)\\K([^-]+)"),
			"\\L\\u\\1",
			boost::match_default | boost::format_all
		);
	}

	static std::string
	normalize_value(const std::string &v)
	{
		return v;
	}

	bool matches(const std::string &k) const { return normalize_key(k) == first; }
};

/**
 * Base class used by HTTP requests and responses.
 */
class message {
public:
	message() = default;
	message(const message &) = default;
	virtual ~message() = default;

	/**
	 * Move constructor.
	 * Note that this does not apply any existing
	 * signal handlers. I think that's probably a bug.
	 */
	message(
		message &&src
	):version_(std::move(src.version_)),
	  headers_(std::move(src.headers_))
	{
	}

	void
{'fraction_non_alphanumeric': 0.17581265291855994, 'fraction_numerical': 0.0027962250961202375, 'mean_word_length': 3.9259896729776247, 'pattern_counts': {'":': 2, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1424248', 'n_tokens_mistral': 1067, 'n_tokens_neox': 1000, 'n_words': 254}