<commit_before>#ifndef MEDIAFACTORY_H
#define MEDIAFACTORY_H
#include "media.h"
#include <string>

class MediaFactory
{
private:
    Media* mediaTemplates[];
public:
    MediaFactory();    //fills mediatemplates with instances of each instantiatable Media object
    ~MediaFactory();
    Media *createMedia(string,ifstream&);    //parses input to create Media objects
    Media *createMedia(const Media& m);        //used in place of a copy constructor for Media
};

/*
class MovieFactory{
private:
	Movie* movieTemplates[3];
	//TODO: hashtable
public:
 	MovieFactory() {
    	movieTemplates[0] = new ClassicMovie();
        movieTemplates[1] = new DramaMovie();
        movieTemplates[2] = new ComedyMovie();
    }

    ~MovieFactory() {
        for (int i = 0; i < 3; i++) {
        	delete movieTemplates[i];
            movieTemplates[i] = NULL;
        }
    }

    Movie* createMovie(string genre, ifstream& inputFile) {	//NOTE: should this take in more data and create the entire movie?
    	//TODO: replace this method with one that uses hashtable.
    	
    	Movie* createdMovie = NULL;
    	if(genre == "C") createdMovie = movieTemplates[0] -> create();    //TODO: isolate this bit into its own method.
		if(genre == "D") createdMovie = movieTemplates[1] -> create();
		if(genre == "F") createdMovie = movieTemplates[2] -> create();
		
        const string* dataTypeNames = createdMovie -> dataTypeNames();
        int dataTypeCount = createdMovie -> dataTypeCount();
  
		for(int i = 0; i < dataTypeCount-1; i++){	//TODO: error checking
			string currentData;
			getline(inputFile, currentData, ',');
            createdMovie -> addData(dataTypeNames[i],currentData);
		}

		string lastData;
		getline(inputFile, lastData);
		createdMovie -> addData(dataTypeNames[dataTypeCount-1],lastData);

		return createdMovie;
    }

    Movie* createMovie(const Movie& m) {    //used in place of a copy constructor for movies
        Movie* createdMovie = NULL;
        string genre = m.genre();
        if(genre == "C") createdMovie = movieTemplates[0] -> create();
        if(genre == "D") createdMovie = movieTemplates[1] -> create();
        if(genre == "F") createdMovie = movieTemplates[2] -> create();

        const string* dataTypeNames = createdMovie -> dataTypeNames();
        int dataTypeCount = m.dataTypeCount();
        
        for(int i = 0; i < dataTypeCount; i++){    //TODO: error checking
            string currentData = m.getData(dataTypeNames[i]); 
            createdMovie -> addData(dataTypeNames[i],currentData);
        }
        return createdMovie;
    }
};
*/<commit_msg>MediaFactory Update<commit_after>#ifndef MEDIAFACTORY_H
#define MEDIAFACTORY_H
#include "media.h"
#include <string>

class MediaFactory
{
public:
    MediaFactory();    //fills mediatemplates with instances of each instantiatable Media object
    ~MediaFactory();
    Media *createMedia(string arg); //parses input to create Media objects
    Media *createMedia(const Media& m); // used in place of a copy constructor for Media
};
{'fraction_non_alphanumeric': 0.12030323005932762, 'fraction_numerical': 0.005273566249176005, 'mean_word_length': 3.1862068965517243, 'pattern_counts': {'":': 0, '<': 8, '<?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': '2192314', 'n_tokens_mistral': 953, 'n_tokens_neox': 893, 'n_words': 263}