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:
adrian17 committed 2013-09-28 23:05:36 +02:00
1 parent 6fc2ad56a4
commit 58d8bc86c5
4 files changed
+2 -36

No files matched your search

-29
View File
@@ -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)
{}
-3
View File
@@ -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
-2
View File
@@ -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);
+2 -2
View File
@@ -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");
}