traffic-generator/src/ModelRead.cpp
/**
 * Returns true if the next line equals 'header'.
 *
 * @param file The file to peak in
 * @param header The string to find in the next line
 *
 */
Returns true if the next line equals 'header'.
@param file The file to peak in
@param header The string to find in the next line
Returns true if the next line equals ' header ' . @param file The file to peak in @param header The string to find in the next line
bool PeekForHeader(ifstream& file, string header) {
	int len = file.tellg();
	std::string line;
	getline(file, line); 
	getline(file, line);
	file.seekg(len ,std::ios_base::beg);
	return(line.compare(header) == 0);
}
bool PeekForHeader ( ifstream & file , string header ) { int len = file . tellg ( ) ; std :: string line ; getline ( file , line ) ; getline ( file , line ) ; file . seekg ( len , std :: ios_base :: beg ) ; return ( line . compare ( header ) == 0 ) ; }
Returns true if the next line equals 'header'.
Returns true if the next line equals ' header ' .
// Get current position // Read line //Finish reading the last line // Return to position before "Read line".