Subversion Repositories spk

Rev

Rev 160 | Rev 170 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 160 Rev 166
Line 411... Line 411...
411
	}
411
	}
412
	m_bSeekP = bSeekP;
412
	m_bSeekP = bSeekP;
413
	return m_fId.is_open();
413
	return m_fId.is_open();
414
}
414
}
415
 
415
 
416
std::vector<Utils::String> *CFileIO::readLines()
416
std::vector<Utils::String>* CFileIO::readLines() const
417
{
417
{
418
	if ( _sFilename.empty() ) return 0;
418
	if (_sFilename.empty()) return 0;
419
 
419
 
420
	std::vector<Utils::String> *file = new std::vector<Utils::String>;
420
	std::vector<Utils::String>* file = new std::vector<Utils::String>;
421
	Utils::String line;
421
	Utils::String line;
422
	file->clear();
422
	file->clear();
423
	std::ifstream infile (_sFilename.c_str(), std::ios_base::in);
423
	std::ifstream infile(_sFilename.c_str(), std::ios_base::in);
424
	while (getline(infile, line, '\n')) {
424
	while (getline(infile, line, '\n')) {
425
		file->push_back(Utils::String(line).removeChar((char)0));
425
		file->push_back(Utils::String(line).removeChar((char)0));
426
	}
426
	}
427
 
427
 
428
	infile.close();
428
	infile.close();
429
 
429
 
430
	return file;
430
	return file;
-
 
431
}
-
 
432
size_t CFileIO::readLines(std::vector<Utils::String> &to) const
-
 
433
{
-
 
434
	if (_sFilename.empty()) return 0;
-
 
435
 
-
 
436
	Utils::String line;
-
 
437
	std::ifstream infile(_sFilename.c_str(), std::ios_base::in);
-
 
438
	while (getline(infile, line, '\n')) {
-
 
439
		to.push_back(Utils::String(line).removeChar((char)0));
-
 
440
	}
-
 
441
 
-
 
442
	infile.close();
-
 
443
 
-
 
444
	return to.size();
431
}
445
}
432
 
446
 
433
 
447
 
434
CyStringList *CFileIO::ReadLinesStr()
448
CyStringList *CFileIO::ReadLinesStr()
435
{
449
{