Пример #1
0
void createDataStructures(){
	ifstream myfile;
	myfile.open ("../../iv04/additional/tableform_data/articles_by_author_dupcorrect.txt");
	string article_id, author_id, authorname;
	int num_author;
	
	if (!myfile){
		printf("createDataStructures:: Error in openening file \n");
	}
	else {
		while (!myfile.eof( )){ 
			myfile >> article_id >> num_author >> author_id;
			getline(myfile, authorname);
			
			if ( author_id_name.count(author_id)>0 ) { 
			}
			else{
				author_id_name[author_id] = authorname;
				author_by_id[author_id] = new Author(author_id);
				authors.push_back(author_by_id[author_id]);
			}
			
			/*
			
			if( article_id_art.count(article_id) > 0) {
			}
			else {
				article_id_art[article_id] = new Article(article_id, num_author);
				articles.push_back(article_id_art[article_id]);
			}
			
			*/
			//Article * a = article_id_art[article_id];
			//Author * auth = author_by_id[author_id]; 
			
			//a-> addAuthor(author_id);
			//auth -> addPub(article_id);
		}
	}
	myfile.close();
	
}