Subversion Repositories spk

Rev

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

Rev 200 Rev 211
Line 490... Line 490...
490
 
490
 
491
	infile.close();
491
	infile.close();
492
 
492
 
493
	return to.size();
493
	return to.size();
494
}
494
}
495
 
-
 
496
Utils::CStringList *CFileIO::readLinesStr()
495
size_t CFileIO::readLines(Utils::WStringList& to) const
497
{
496
{
498
	if ( _sFilename.empty() ) return 0;
497
	if (_sFilename.empty()) return 0;
499
 
498
 
500
	Utils::CStringList *file = new Utils::CStringList();
-
 
501
	Utils::String line;
499
	std::wstring line;
502
	std::ifstream infile (_sFilename.c_str(), std::ios_base::in);
500
	std::wifstream infile(_sFilename.c_str(), std::ios_base::in);
503
	while (getline(infile, line, '\n'))	{
501
	while (getline(infile, line, L'\n')) {
504
		file->pushBack(line.removeChar((char)0));
502
		to.pushBack(Utils::WString(line).remove((char)0));
505
	}
503
	}
506
 
504
 
507
	infile.close();
505
	infile.close();
508
 
506
 
509
	return file;
507
	return to.size();
510
}
508
}
511
 
-
 
512
 
509
 
513
bool CFileIO::put(const unsigned char c)
510
bool CFileIO::put(const unsigned char c)
514
{
511
{
515
	if ( !this->isOpened() ) return false;
512
	if ( !this->isOpened() ) return false;
516
 
513
 
Line 1172... Line 1169...
1172
{
1169
{
1173
	return _toFileData(_sFilename);
1170
	return _toFileData(_sFilename);
1174
}
1171
}
1175
std::string CFileIO::_toFileData(const Utils::WString &str)
1172
std::string CFileIO::_toFileData(const Utils::WString &str)
1176
{
1173
{
-
 
1174
#pragma warning(disable:4244)
1177
	return std::string(str.begin(), str.end());
1175
	return std::string(str.begin(), str.end());
-
 
1176
#pragma warning(default:4244)
1178
}
1177
}