mirror of
https://github.com/libretro/Play-.git
synced 2025-01-10 18:42:53 +00:00
568d187f87
git-svn-id: http://svn.purei.org/purei/trunk@185 b36208d7-6611-0410-8bec-b1987f11c4a2
36 lines
598 B
C++
36 lines
598 B
C++
#include <string.h>
|
|
#include "Utils.h"
|
|
|
|
using namespace Framework;
|
|
using namespace std;
|
|
|
|
void Utils::GetLine(CStream* pS, string* pStr, bool nIgnoreCR)
|
|
{
|
|
unsigned char nChar;
|
|
|
|
(*pStr) = "";
|
|
|
|
pS->Read(&nChar, 1);
|
|
while(!pS->IsEOF())
|
|
{
|
|
if(!(nIgnoreCR && (nChar == '\r')))
|
|
{
|
|
(*pStr) += nChar;
|
|
}
|
|
pS->Read(&nChar, 1);
|
|
if(nChar == '\n') break;
|
|
}
|
|
}
|
|
|
|
const char* Utils::GetFilenameFromPath(const char* sPath, char nSeparator)
|
|
{
|
|
const char* sTemp;
|
|
sTemp = strchr(sPath, nSeparator);
|
|
while(sTemp != NULL)
|
|
{
|
|
sPath = sTemp + 1;
|
|
sTemp = strchr(sPath, nSeparator);
|
|
}
|
|
return sPath;
|
|
}
|