#include "URL.h"
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

//Note: having operator>> read in one format (RDF)
// and operator<< write in another format (HTML)
// is almost always a bad idea. We are just doing it
// as an excersice. In this case you would want to
// give these functions different names (e.g. writeAsHTML)
int main(int argc, char* argv[]){

	ifstream opendir("//Engr_asu/ECE352/computer_science.txt");
	if (opendir == 0) {
		cout << "Could not open input file" << endl;
	}

	//Change this filename to write to your own folder.
	ofstream fout("//Engr_asu/ECE352/ps2out.html");
	if (fout == 0) {
		cout << "Could not open output file" << endl;
	}

	fout << "<html><head><title>PS2 Output</title></head><body>" << endl 
		<< "<h1>PS2 Output</h1>" << endl << "<ul>" << endl;
	
	URL next;
	while (opendir >> next){
		fout << "<li>" << next << endl;
	}
	fout << "</ul>" << endl << "</body></html>" << endl;
	fout.close();
	return 0;
}