<commit_before>#ifndef SHOW_H
#define SHOW_H

#include <iostream>
#include <string>

enum showtype{ 
	COMMENTARY,
	EPISODE,
	MOVIE,
	SPECIAL
};

class Show {
	public:
		std::string file,
			name;
		showtype type;

		Show(std::string f = std::string(), std::string n = std::string(),
			showtype t = EPISODE, unsigned int w = 0) :
		 	file(f), name(n), type(t), watched(w) {
		}

		Show(const Show& other);
		Show(Show& other);
		std::string print();
		void printdetail(std::ostream& o);
		void watch();
		const unsigned int getwatched();

		static showtype gettype(const std::string& t);

	private:
		unsigned int watched;
};

#endif <commit_msg>add soci specialization for Show<commit_after>#ifndef SHOW_H
#define SHOW_H

#include <iostream>
#include <string>

#include "soci/soci.h"

enum showtype{ 
	COMMENTARY,
	EPISODE,
	MOVIE,
	SPECIAL
};

class Show {
	public:
		std::string file,
			name;
		showtype type;

		Show(std::string f = std::string(), std::string n = std::string(),
			showtype t = EPISODE, unsigned int w = 0) :
		 	file(f), name(n), type(t), watched(w) {
		}

		Show(const Show& other);
		Show(Show& other);
		std::string print();
		void printdetail(std::ostream& o);
		void watch();
		const unsigned int getwatched();

		static showtype gettype(const std::string& t);

	private:
		unsigned int watched;

	template<class Show> friend struct soci::type_conversion;
};


/**
 * SOCI type conversion code for database access ease
 */
namespace soci {
	template<>
	struct type_conversion<Show> {

		typedef values base_type;

		static void from_base(const values& v, indicator /* ind */, Show s) {
			s.name = v.get<std::string>("NAME");
			s.file = v.get<std::string>("FILE");
			s.watched = v.get<int>("WATCHED");

			std::string t = v.get<std::string>("TYPE");

			if(t == "EPISODE")
				s.type = EPISODE;
			else if(t == "MOVIE")
				s.type = MOVIE;
			else if(t == "SPECIAL")
				s.type = SPECIAL;
			else if(t == "COMMENTARY")
				s.type = COMMENTARY;


		}

		static void to_base(const Show& s, values& v, indicator& ind) {
			v.set("NAME", s.name);
			v.set("FILE", s.file);
			v.set("WATCHED", s.watched);

			switch(s.type) {
				case COMMENTARY:
					v.set("TYPE", std::string("COMMENTARY"));
					break;
				case EPISODE:
					v.set("TYPE", std::string("EPISODE"));
					break;
				case MOVIE:
					v.set("TYPE", std::string("MOVIE"));
					break;
				case SPECIAL:
					v.set("TYPE", std::string("SPECIAL"));
					break;
			}

			ind = i_ok;
		}

	};
}
#endif 
{'fraction_non_alphanumeric': 0.16472478907191643, 'fraction_numerical': 0.0008035355564483728, 'mean_word_length': 3.5272727272727273, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, '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': '4746791', 'n_tokens_mistral': 1069, 'n_tokens_neox': 909, 'n_words': 232}