mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Removed two functions as they are also in Native/file.
Also, removed TabsToSpaces() from the header as it no longer exists.
This commit is contained in:
1 parent
6fc2ad56a4
commit
58d8bc86c5
4 files changed
+2
-36
No files matched your search
@@ -715,35 +715,6 @@ std::string &GetUserPath(const unsigned int DirIDX, const std::string &newPath)
|
||||
return paths[DirIDX];
|
||||
}
|
||||
|
||||
bool WriteStringToFile(bool text_file, const std::string &str, const char *filename)
|
||||
{
|
||||
FILE *f = OpenCFile(filename, text_file ? "w" : "wb");
|
||||
if (!f)
|
||||
return false;
|
||||
size_t len = str.size();
|
||||
if (len != fwrite(str.data(), 1, str.size(), f)) // TODO: string::data() may not be contiguous
|
||||
{
|
||||
fclose(f);
|
||||
return false;
|
||||
}
|
||||
fclose(f);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ReadFileToString(bool text_file, const char *filename, std::string &str)
|
||||
{
|
||||
FILE *f = OpenCFile(filename, text_file ? "r" : "rb");
|
||||
if (!f)
|
||||
return false;
|
||||
size_t len = (size_t)GetSize(f);
|
||||
char *buf = new char[len + 1];
|
||||
buf[fread(buf, 1, len, f)] = 0;
|
||||
str = std::string(buf, len);
|
||||
fclose(f);
|
||||
delete [] buf;
|
||||
return true;
|
||||
}
|
||||
|
||||
IOFile::IOFile()
|
||||
: m_file(NULL), m_good(true)
|
||||
{}
|
||||
|
||||
@@ -128,9 +128,6 @@ std::string GetBundleDirectory();
|
||||
std::string &GetExeDirectory();
|
||||
#endif
|
||||
|
||||
bool WriteStringToFile(bool text_file, const std::string &str, const char *filename);
|
||||
bool ReadFileToString(bool text_file, const char *filename, std::string &str);
|
||||
|
||||
// simple wrapper for cstdlib file functions to
|
||||
// hopefully will make error checking easier
|
||||
// and make forgetting an fclose() harder
|
||||
|
||||
@@ -52,8 +52,6 @@ std::string ThousandSeparate(I value, int spaces = 0)
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
std::string TabsToSpaces(int tab_size, const std::string &in);
|
||||
|
||||
// "C:/Windows/winhelp.exe" to "C:/Windows/", "winhelp", ".exe"
|
||||
bool SplitPath(const std::string& full_path, std::string* _pPath, std::string* _pFilename, std::string* _pExtension);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.
|
||||
|
||||
#include "headless/Compare.h"
|
||||
#include "Common/FileUtil.h"
|
||||
#include "file/file_util.h"
|
||||
#include "Core/Host.h"
|
||||
|
||||
#include <cmath>
|
||||
@@ -250,7 +250,7 @@ bool CompareOutput(const std::string &bootFilename, const std::string &output, b
|
||||
printf("%s", output.c_str());
|
||||
printf("============== expected output:\n");
|
||||
std::string fullExpected;
|
||||
if (File::ReadFileToString(true, expect_filename.c_str(), fullExpected))
|
||||
if (readFileToString(true, expect_filename.c_str(), fullExpected))
|
||||
printf("%s", fullExpected.c_str());
|
||||
printf("===============================\n");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user