Add semi-stub UTF8_fstream function to SDL port
This commit is contained in:
parent
a4fb078f3c
commit
c8e4dee70a
|
@ -387,6 +387,28 @@ FCEUD_Update(uint8 *XBuf,
|
|||
/**
|
||||
* Opens a file to be read a byte at a time.
|
||||
*/
|
||||
std::fstream* FCEUD_UTF8_fstream(const char *n, const char *m)
|
||||
{
|
||||
std::ios_base::openmode mode = std::ios_base::binary;
|
||||
if(!strcmp(m,"r") || !strcmp(m,"rb"))
|
||||
mode |= std::ios_base::in;
|
||||
else if(!strcmp(m,"w") || !strcmp(m,"wb"))
|
||||
mode |= std::ios_base::out | std::ios_base::trunc;
|
||||
else if(!strcmp(m,"a") || !strcmp(m,"ab"))
|
||||
mode |= std::ios_base::out | std::ios_base::app;
|
||||
else if(!strcmp(m,"r+") || !strcmp(m,"r+b"))
|
||||
mode |= std::ios_base::in | std::ios_base::out;
|
||||
else if(!strcmp(m,"w+") || !strcmp(m,"w+b"))
|
||||
mode |= std::ios_base::in | std::ios_base::out | std::ios_base::trunc;
|
||||
else if(!strcmp(m,"a+") || !strcmp(m,"a+b"))
|
||||
mode |= std::ios_base::in | std::ios_base::out | std::ios_base::app;
|
||||
|
||||
return new std::fstream(n,mode);
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a file, C++ style, to be read a byte at a time.
|
||||
*/
|
||||
FILE *FCEUD_UTF8fopen(const char *fn, const char *mode)
|
||||
{
|
||||
return(fopen(fn,mode));
|
||||
|
|
Loading…
Reference in New Issue