src/Commands.cpp
static bool readEntry(Entry& e, std::FILE *file) {
	int endChecker = std::fscanf(file, "\"%d\";", &e.id);
	
	if (endChecker < 0) {
		e.valid = false;
		return false;
	}

	readStringField(e.title, file, TITLE_CHAR_MAX);
	std::fscanf(file, "\"%d\";", &e.year);
	readStringField(e.authors, file, AUTHORS_CHAR_MAX);
	std::fscanf(file, "\"%d\";", &e.citations);
	readStringField(e.updateTimestamp, file, TIMESTAMP_CHAR_MAX);
	readStringField(e.snippet, file, SNIPPET_CHAR_MAX);
	
	e.valid = true;
	return true;
}
//! Reads a whole line, field by field, from the CSV file
/*!
 * @param e Entry to read
 * @param file File with contents
 *
 * @return True if the entry was successfully read, false if we've reached the end of the file
 */
Reads a whole line, field by field, from the CSV file
@param e Entry to read
@param file File with contents

@return True if the entry was successfully read, false if we've reached the end of the file
Reads a whole line field by field from the CSV file @param e Entry to read @param file File with contents @return True if the entry was successfully read false if we ' ve reached the end of the file
static bool readEntry(Entry& e, std::FILE *file) {
	int endChecker = std::fscanf(file, "\"%d\";", &e.id);
	if (endChecker < 0) {
		e.valid = false;
		return false;
	}
	readStringField(e.title, file, TITLE_CHAR_MAX);
	std::fscanf(file, "\"%d\";", &e.year);
	readStringField(e.authors, file, AUTHORS_CHAR_MAX);
	std::fscanf(file, "\"%d\";", &e.citations);
	readStringField(e.updateTimestamp, file, TIMESTAMP_CHAR_MAX);
	readStringField(e.snippet, file, SNIPPET_CHAR_MAX);
	e.valid = true;
	return true;
}
static bool readEntry ( Entry & e , std :: FILE * file ) { int endChecker = std :: fscanf ( file , " \" \" " , & e . id ) ; if ( endChecker < 0 ) { e . valid = false ; return false ; } readStringField ( e . title , file , TITLE_CHAR_MAX ) ; std :: fscanf ( file , " \" \" " , & e . year ) ; readStringField ( e . authors , file , AUTHORS_CHAR_MAX ) ; std :: fscanf ( file , " \" \" " , & e . citations ) ; readStringField ( e . updateTimestamp , file , TIMESTAMP_CHAR_MAX ) ; readStringField ( e . snippet , file , SNIPPET_CHAR_MAX ) ; e . valid = true ; return true ; }
Reads a whole line, field by field, from the CSV file
 @param e Entry to read
 @param file File with contents
Reads a whole line field by field from the CSV file @param e Entry to read @param file File with contents