mirror of
https://github.com/libretro/Play-.git
synced 2025-01-10 10:31:05 +00:00
20 lines
355 B
C++
20 lines
355 B
C++
#include <string.h>
|
|
#include "Utils.h"
|
|
|
|
std::string Utils::GetLine(Framework::CStream* stream, bool nIgnoreCR)
|
|
{
|
|
std::string result;
|
|
unsigned char nChar = 0;
|
|
stream->Read(&nChar, 1);
|
|
while(!stream->IsEOF())
|
|
{
|
|
if(nChar == '\n') break;
|
|
if(!(nIgnoreCR && (nChar == '\r')))
|
|
{
|
|
result += nChar;
|
|
}
|
|
stream->Read(&nChar, 1);
|
|
}
|
|
return result;
|
|
}
|