Merge pull request #5611 from JosJuice/reorganize-file-namespace

Reorganize File namespace
This commit is contained in:
Leo Lam 2017-06-15 23:28:36 +02:00 committed by GitHub
commit 8f460a1cda
104 changed files with 349 additions and 259 deletions

View File

@ -7,6 +7,8 @@
#include <string> #include <string>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
#include "Common/Swap.h" #include "Common/Swap.h"

View File

@ -16,8 +16,9 @@
#include <array> #include <array>
#include <string> #include <string>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/NonCopyable.h" #include "Common/NonCopyable.h"
class WaveFileWriter : NonCopyable class WaveFileWriter : NonCopyable

View File

@ -7,6 +7,7 @@ set(SRCS
Config/Layer.cpp Config/Layer.cpp
Config/Section.cpp Config/Section.cpp
ENetUtil.cpp ENetUtil.cpp
File.cpp
FileSearch.cpp FileSearch.cpp
FileUtil.cpp FileUtil.cpp
GekkoDisassembler.cpp GekkoDisassembler.cpp

View File

@ -27,6 +27,7 @@
#include "Common/Assert.h" #include "Common/Assert.h"
#include "Common/Common.h" #include "Common/Common.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Flag.h" #include "Common/Flag.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"

View File

@ -63,6 +63,7 @@
<ClInclude Include="ENetUtil.h" /> <ClInclude Include="ENetUtil.h" />
<ClInclude Include="Event.h" /> <ClInclude Include="Event.h" />
<ClInclude Include="FifoQueue.h" /> <ClInclude Include="FifoQueue.h" />
<ClInclude Include="File.h" />
<ClInclude Include="FileSearch.h" /> <ClInclude Include="FileSearch.h" />
<ClInclude Include="FileUtil.h" /> <ClInclude Include="FileUtil.h" />
<ClInclude Include="FixedSizeQueue.h" /> <ClInclude Include="FixedSizeQueue.h" />
@ -166,6 +167,7 @@
<ClCompile Include="Config\Layer.cpp" /> <ClCompile Include="Config\Layer.cpp" />
<ClCompile Include="Config\Section.cpp" /> <ClCompile Include="Config\Section.cpp" />
<ClCompile Include="ENetUtil.cpp" /> <ClCompile Include="ENetUtil.cpp" />
<ClCompile Include="File.cpp" />
<ClCompile Include="FileSearch.cpp" /> <ClCompile Include="FileSearch.cpp" />
<ClCompile Include="FileUtil.cpp" /> <ClCompile Include="FileUtil.cpp" />
<ClCompile Include="GekkoDisassembler.cpp" /> <ClCompile Include="GekkoDisassembler.cpp" />

View File

@ -252,6 +252,7 @@
<ClInclude Include="GL\GLExtensions\EXT_texture_compression_s3tc.h"> <ClInclude Include="GL\GLExtensions\EXT_texture_compression_s3tc.h">
<Filter>GL\GLExtensions</Filter> <Filter>GL\GLExtensions</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="File.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="CDUtils.cpp" /> <ClCompile Include="CDUtils.cpp" />
@ -319,6 +320,7 @@
<ClCompile Include="ucrtFreadWorkaround.cpp" /> <ClCompile Include="ucrtFreadWorkaround.cpp" />
<ClCompile Include="Analytics.cpp" /> <ClCompile Include="Analytics.cpp" />
<ClCompile Include="MD5.cpp" /> <ClCompile Include="MD5.cpp" />
<ClCompile Include="File.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Text Include="CMakeLists.txt" /> <Text Include="CMakeLists.txt" />

133
Source/Core/Common/File.cpp Normal file
View File

@ -0,0 +1,133 @@
// Copyright 2008 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include <cstddef>
#include <cstdio>
#include <string>
#ifdef _WIN32
#include <io.h>
#include "Common/CommonFuncs.h"
#include "Common/StringUtil.h"
#else
#include <unistd.h>
#endif
#include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h"
namespace File
{
IOFile::IOFile() : m_file(nullptr), m_good(true)
{
}
IOFile::IOFile(std::FILE* file) : m_file(file), m_good(true)
{
}
IOFile::IOFile(const std::string& filename, const char openmode[]) : m_file(nullptr), m_good(true)
{
Open(filename, openmode);
}
IOFile::~IOFile()
{
Close();
}
IOFile::IOFile(IOFile&& other) noexcept : m_file(nullptr), m_good(true)
{
Swap(other);
}
IOFile& IOFile::operator=(IOFile&& other) noexcept
{
Swap(other);
return *this;
}
void IOFile::Swap(IOFile& other) noexcept
{
std::swap(m_file, other.m_file);
std::swap(m_good, other.m_good);
}
bool IOFile::Open(const std::string& filename, const char openmode[])
{
Close();
#ifdef _WIN32
_tfopen_s(&m_file, UTF8ToTStr(filename).c_str(), UTF8ToTStr(openmode).c_str());
#else
m_file = fopen(filename.c_str(), openmode);
#endif
m_good = IsOpen();
return m_good;
}
bool IOFile::Close()
{
if (!IsOpen() || 0 != std::fclose(m_file))
m_good = false;
m_file = nullptr;
return m_good;
}
void IOFile::SetHandle(std::FILE* file)
{
Close();
Clear();
m_file = file;
}
u64 IOFile::GetSize()
{
if (IsOpen())
return File::GetSize(m_file);
else
return 0;
}
bool IOFile::Seek(s64 off, int origin)
{
if (!IsOpen() || 0 != fseeko(m_file, off, origin))
m_good = false;
return m_good;
}
u64 IOFile::Tell() const
{
if (IsOpen())
return ftello(m_file);
else
return UINT64_MAX;
}
bool IOFile::Flush()
{
if (!IsOpen() || 0 != std::fflush(m_file))
m_good = false;
return m_good;
}
bool IOFile::Resize(u64 size)
{
#ifdef _WIN32
if (!IsOpen() || 0 != _chsize_s(_fileno(m_file), size))
#else
// TODO: handle 64bit and growing
if (!IsOpen() || 0 != ftruncate(fileno(m_file), size))
#endif
m_good = false;
return m_good;
}
} // namespace File

93
Source/Core/Common/File.h Normal file
View File

@ -0,0 +1,93 @@
// Copyright 2008 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#pragma once
#include <cstddef>
#include <cstdio>
#include <string>
#include "Common/CommonTypes.h"
#include "Common/NonCopyable.h"
namespace File
{
// simple wrapper for cstdlib file functions to
// hopefully will make error checking easier
// and make forgetting an fclose() harder
class IOFile : public NonCopyable
{
public:
IOFile();
IOFile(std::FILE* file);
IOFile(const std::string& filename, const char openmode[]);
~IOFile();
IOFile(IOFile&& other) noexcept;
IOFile& operator=(IOFile&& other) noexcept;
void Swap(IOFile& other) noexcept;
bool Open(const std::string& filename, const char openmode[]);
bool Close();
template <typename T>
bool ReadArray(T* data, size_t length, size_t* pReadBytes = nullptr)
{
size_t read_bytes = 0;
if (!IsOpen() || length != (read_bytes = std::fread(data, sizeof(T), length, m_file)))
m_good = false;
if (pReadBytes)
*pReadBytes = read_bytes;
return m_good;
}
template <typename T>
bool WriteArray(const T* data, size_t length)
{
if (!IsOpen() || length != std::fwrite(data, sizeof(T), length, m_file))
m_good = false;
return m_good;
}
bool ReadBytes(void* data, size_t length)
{
return ReadArray(reinterpret_cast<char*>(data), length);
}
bool WriteBytes(const void* data, size_t length)
{
return WriteArray(reinterpret_cast<const char*>(data), length);
}
bool IsOpen() const { return nullptr != m_file; }
// m_good is set to false when a read, write or other function fails
bool IsGood() const { return m_good; }
explicit operator bool() const { return IsGood() && IsOpen(); }
std::FILE* GetHandle() { return m_file; }
void SetHandle(std::FILE* file);
bool Seek(s64 off, int origin);
u64 Tell() const;
u64 GetSize();
bool Resize(u64 size);
bool Flush();
// clear error state
void Clear()
{
m_good = true;
std::clearerr(m_file);
}
private:
std::FILE* m_file;
bool m_good;
};
} // namespace File

View File

@ -16,6 +16,7 @@
#include "Common/CommonFuncs.h" #include "Common/CommonFuncs.h"
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
@ -901,118 +902,4 @@ bool ReadFileToString(const std::string& filename, std::string& str)
return retval; return retval;
} }
IOFile::IOFile() : m_file(nullptr), m_good(true)
{
}
IOFile::IOFile(std::FILE* file) : m_file(file), m_good(true)
{
}
IOFile::IOFile(const std::string& filename, const char openmode[]) : m_file(nullptr), m_good(true)
{
Open(filename, openmode);
}
IOFile::~IOFile()
{
Close();
}
IOFile::IOFile(IOFile&& other) noexcept : m_file(nullptr), m_good(true)
{
Swap(other);
}
IOFile& IOFile::operator=(IOFile&& other) noexcept
{
Swap(other);
return *this;
}
void IOFile::Swap(IOFile& other) noexcept
{
std::swap(m_file, other.m_file);
std::swap(m_good, other.m_good);
}
bool IOFile::Open(const std::string& filename, const char openmode[])
{
Close();
#ifdef _WIN32
_tfopen_s(&m_file, UTF8ToTStr(filename).c_str(), UTF8ToTStr(openmode).c_str());
#else
m_file = fopen(filename.c_str(), openmode);
#endif
m_good = IsOpen();
return m_good;
}
bool IOFile::Close()
{
if (!IsOpen() || 0 != std::fclose(m_file))
m_good = false;
m_file = nullptr;
return m_good;
}
void IOFile::SetHandle(std::FILE* file)
{
Close();
Clear();
m_file = file;
}
u64 IOFile::GetSize()
{
if (IsOpen())
return File::GetSize(m_file);
else
return 0;
}
bool IOFile::Seek(s64 off, int origin)
{
if (!IsOpen() || 0 != fseeko(m_file, off, origin))
m_good = false;
return m_good;
}
u64 IOFile::Tell() const
{
if (IsOpen())
return ftello(m_file);
else
return UINT64_MAX;
}
bool IOFile::Flush()
{
if (!IsOpen() || 0 != std::fflush(m_file))
m_good = false;
return m_good;
}
bool IOFile::Resize(u64 size)
{
if (!IsOpen() ||
0 !=
#ifdef _WIN32
// ector: _chsize sucks, not 64-bit safe
// F|RES: changed to _chsize_s. i think it is 64-bit safe
_chsize_s(_fileno(m_file), size)
#else
// TODO: handle 64bit and growing
ftruncate(fileno(m_file), size)
#endif
)
m_good = false;
return m_good;
}
} // namespace } // namespace

View File

@ -5,7 +5,6 @@
#pragma once #pragma once
#include <cstddef> #include <cstddef>
#include <cstdio>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <vector> #include <vector>
@ -163,85 +162,6 @@ std::string& GetExeDirectory();
bool WriteStringToFile(const std::string& str, const std::string& filename); bool WriteStringToFile(const std::string& str, const std::string& filename);
bool ReadFileToString(const std::string& filename, std::string& str); bool ReadFileToString(const std::string& filename, std::string& str);
// simple wrapper for cstdlib file functions to
// hopefully will make error checking easier
// and make forgetting an fclose() harder
class IOFile : public NonCopyable
{
public:
IOFile();
IOFile(std::FILE* file);
IOFile(const std::string& filename, const char openmode[]);
~IOFile();
IOFile(IOFile&& other) noexcept;
IOFile& operator=(IOFile&& other) noexcept;
void Swap(IOFile& other) noexcept;
bool Open(const std::string& filename, const char openmode[]);
bool Close();
template <typename T>
bool ReadArray(T* data, size_t length, size_t* pReadBytes = nullptr)
{
size_t read_bytes = 0;
if (!IsOpen() || length != (read_bytes = std::fread(data, sizeof(T), length, m_file)))
m_good = false;
if (pReadBytes)
*pReadBytes = read_bytes;
return m_good;
}
template <typename T>
bool WriteArray(const T* data, size_t length)
{
if (!IsOpen() || length != std::fwrite(data, sizeof(T), length, m_file))
m_good = false;
return m_good;
}
bool ReadBytes(void* data, size_t length)
{
return ReadArray(reinterpret_cast<char*>(data), length);
}
bool WriteBytes(const void* data, size_t length)
{
return WriteArray(reinterpret_cast<const char*>(data), length);
}
bool IsOpen() const { return nullptr != m_file; }
// m_good is set to false when a read, write or other function fails
bool IsGood() const { return m_good; }
explicit operator bool() const { return IsGood() && IsOpen(); }
std::FILE* GetHandle() { return m_file; }
void SetHandle(std::FILE* file);
bool Seek(s64 off, int origin);
u64 Tell() const;
u64 GetSize();
bool Resize(u64 size);
bool Flush();
// clear error state
void Clear()
{
m_good = true;
std::clearerr(m_file);
}
private:
std::FILE* m_file;
bool m_good;
};
} // namespace
// To deal with Windows being dumb at unicode: // To deal with Windows being dumb at unicode:
template <typename T> template <typename T>
void OpenFStream(T& fstream, const std::string& filename, std::ios_base::openmode openmode) void OpenFStream(T& fstream, const std::string& filename, std::ios_base::openmode openmode)
@ -252,3 +172,5 @@ void OpenFStream(T& fstream, const std::string& filename, std::ios_base::openmod
fstream.open(filename.c_str(), openmode); fstream.open(filename.c_str(), openmode);
#endif #endif
} }
} // namespace

View File

@ -401,7 +401,7 @@ bool IniFile::Load(const std::string& filename, bool keep_current_data)
// Open file // Open file
std::ifstream in; std::ifstream in;
OpenFStream(in, filename, std::ios::in); File::OpenFStream(in, filename, std::ios::in);
if (in.fail()) if (in.fail())
return false; return false;
@ -474,7 +474,7 @@ bool IniFile::Save(const std::string& filename)
{ {
std::ofstream out; std::ofstream out;
std::string temp = File::GetTempFilenameForAtomicWrite(filename); std::string temp = File::GetTempFilenameForAtomicWrite(filename);
OpenFStream(out, temp, std::ios::out); File::OpenFStream(out, temp, std::ios::out);
if (out.fail()) if (out.fail())
{ {

View File

@ -10,7 +10,7 @@
#include <string> #include <string>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/JitRegister.h" #include "Common/JitRegister.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"

View File

@ -70,7 +70,7 @@ public:
m_num_entries = 0; m_num_entries = 0;
// try opening for reading/writing // try opening for reading/writing
OpenFStream(m_file, filename, ios_base::in | ios_base::out | ios_base::binary); File::OpenFStream(m_file, filename, ios_base::in | ios_base::out | ios_base::binary);
m_file.seekg(0, std::ios::end); m_file.seekg(0, std::ios::end);
std::fstream::pos_type end_pos = m_file.tellg(); std::fstream::pos_type end_pos = m_file.tellg();

View File

@ -170,7 +170,7 @@ LogContainer::LogContainer(const std::string& shortName, const std::string& full
FileLogListener::FileLogListener(const std::string& filename) FileLogListener::FileLogListener(const std::string& filename)
{ {
OpenFStream(m_logfile, filename, std::ios::app); File::OpenFStream(m_logfile, filename, std::ios::app);
SetEnable(true); SetEnable(true);
} }

View File

@ -9,6 +9,7 @@
#include <vector> #include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/NandPaths.h" #include "Common/NandPaths.h"

View File

@ -5,7 +5,7 @@
#include <chrono> #include <chrono>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/PcapFile.h" #include "Common/PcapFile.h"
namespace namespace

View File

@ -17,7 +17,7 @@
#include <memory> #include <memory>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/NonCopyable.h" #include "Common/NonCopyable.h"
class PCAP final : public NonCopyable class PCAP final : public NonCopyable

View File

@ -41,7 +41,7 @@
#include "Common/CommonFuncs.h" #include "Common/CommonFuncs.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/SDCardUtil.h" #include "Common/SDCardUtil.h"

View File

@ -17,6 +17,7 @@
#endif #endif
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/SettingsHandler.h" #include "Common/SettingsHandler.h"
#include "Common/Timer.h" #include "Common/Timer.h"

View File

@ -13,6 +13,7 @@
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Swap.h" #include "Common/Swap.h"
#include "Core/Movie.h" #include "Core/Movie.h"

View File

@ -17,6 +17,7 @@
#include "Common/CDUtils.h" #include "Common/CDUtils.h"
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"

View File

@ -9,6 +9,7 @@
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"

View File

@ -10,6 +10,7 @@
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Common/NandPaths.h" #include "Common/NandPaths.h"

View File

@ -8,6 +8,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Swap.h" #include "Common/Swap.h"
#include "Core/HW/Memmap.h" #include "Core/HW/Memmap.h"

View File

@ -21,6 +21,7 @@
#include "Common/CPUDetect.h" #include "Common/CPUDetect.h"
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/Flag.h" #include "Common/Flag.h"
#include "Common/Logging/LogManager.h" #include "Common/Logging/LogManager.h"
#include "Common/MemoryUtil.h" #include "Common/MemoryUtil.h"

View File

@ -7,7 +7,7 @@
#include <string> #include <string>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/PcapFile.h" #include "Common/PcapFile.h"
#include "Core/DSP/DSPCaptureLogger.h" #include "Core/DSP/DSPCaptureLogger.h"

View File

@ -8,6 +8,7 @@
#include <vector> #include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
#include "Common/Swap.h" #include "Common/Swap.h"

View File

@ -12,6 +12,7 @@
#include <vector> #include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"

View File

@ -6,7 +6,7 @@
#include <string> #include <string>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Core/Debugger/Dump.h" #include "Core/Debugger/Dump.h"

View File

@ -8,7 +8,7 @@
#include <string> #include <string>
#include <vector> #include <vector>
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Core/FifoPlayer/FifoDataFile.h" #include "Core/FifoPlayer/FifoDataFile.h"

View File

@ -6,6 +6,7 @@
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MathUtil.h" #include "Common/MathUtil.h"

View File

@ -12,6 +12,7 @@
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Hash.h" #include "Common/Hash.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"

View File

@ -14,6 +14,7 @@
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Hash.h" #include "Common/Hash.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"

View File

@ -5,7 +5,7 @@
#include <cinttypes> #include <cinttypes>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Core/DSP/DSPCore.h" #include "Core/DSP/DSPCore.h"
#include "Core/HW/DSPLLE/DSPLLEGlobals.h" #include "Core/HW/DSPLLE/DSPLLEGlobals.h"

View File

@ -8,7 +8,7 @@
#include <string> #include <string>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
#include "Core/DSP/DSPCore.h" #include "Core/DSP/DSPCore.h"

View File

@ -11,7 +11,7 @@
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"

View File

@ -11,6 +11,7 @@
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MemoryUtil.h" #include "Common/MemoryUtil.h"

View File

@ -13,7 +13,7 @@
#include "Common/CommonFuncs.h" #include "Common/CommonFuncs.h"
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
#include "Common/Swap.h" #include "Common/Swap.h"

View File

@ -16,6 +16,7 @@
#include "Common/Assert.h" #include "Common/Assert.h"
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileSearch.h" #include "Common/FileSearch.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"

View File

@ -13,6 +13,7 @@
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"

View File

@ -5,7 +5,7 @@
#include "Core/HW/Sram.h" #include "Core/HW/Sram.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/Swap.h" #include "Common/Swap.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"

View File

@ -23,6 +23,7 @@
#include "Common/Align.h" #include "Common/Align.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Crypto/ec.h" #include "Common/Crypto/ec.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"

View File

@ -268,8 +268,8 @@ void Wiimote::WriteData(const wm_write_data* const wd)
{ {
// TODO Only write parts of the Mii block // TODO Only write parts of the Mii block
std::ofstream file; std::ofstream file;
OpenFStream(file, File::GetUserPath(D_SESSION_WIIROOT_IDX) + "/mii.bin", File::OpenFStream(file, File::GetUserPath(D_SESSION_WIIROOT_IDX) + "/mii.bin",
std::ios::binary | std::ios::out); std::ios::binary | std::ios::out);
file.write((char*)m_eeprom + 0x0FCA, 0x02f0); file.write((char*)m_eeprom + 0x0FCA, 0x02f0);
file.close(); file.close();
} }

View File

@ -144,7 +144,7 @@ void Wiimote::SpeakerData(const wm_speaker_data* sd)
File::Delete("rmtdump.wav"); File::Delete("rmtdump.wav");
File::Delete("rmtdump.bin"); File::Delete("rmtdump.bin");
atexit(stopdamnwav); atexit(stopdamnwav);
OpenFStream(ofile, "rmtdump.bin", ofile.binary | ofile.out); File::OpenFStream(ofile, "rmtdump.bin", ofile.binary | ofile.out);
wav.Start("rmtdump.wav", 6000); wav.Start("rmtdump.wav", 6000);
} }
wav.AddMonoSamples(samples.get(), sd->length * 2); wav.AddMonoSamples(samples.get(), sd->length * 2);

View File

@ -12,6 +12,7 @@
#include <vector> #include <vector>
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"

View File

@ -19,6 +19,7 @@
#include "Common/Assert.h" #include "Common/Assert.h"
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"

View File

@ -12,6 +12,7 @@
#include <vector> #include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/NandPaths.h" #include "Common/NandPaths.h"

View File

@ -14,6 +14,7 @@
#include "Common/Align.h" #include "Common/Align.h"
#include "Common/Crypto/AES.h" #include "Common/Crypto/AES.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/NandPaths.h" #include "Common/NandPaths.h"
@ -36,6 +37,7 @@ static ReturnCode WriteTicket(const IOS::ES::TicketReader& ticket)
const std::string ticket_path = Common::GetTicketFileName(title_id, Common::FROM_SESSION_ROOT); const std::string ticket_path = Common::GetTicketFileName(title_id, Common::FROM_SESSION_ROOT);
File::CreateFullPath(ticket_path); File::CreateFullPath(ticket_path);
File::IOFile ticket_file(ticket_path, "wb"); File::IOFile ticket_file(ticket_path, "wb");
if (!ticket_file) if (!ticket_file)
return ES_EIO; return ES_EIO;

View File

@ -12,6 +12,7 @@
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"

View File

@ -11,6 +11,7 @@
#include "Common/Assert.h" #include "Common/Assert.h"
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/NandPaths.h" #include "Common/NandPaths.h"
#include "Core/HW/Memmap.h" #include "Core/HW/Memmap.h"

View File

@ -8,6 +8,7 @@
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/Swap.h" #include "Common/Swap.h"

View File

@ -8,6 +8,7 @@
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Core/HW/Memmap.h" #include "Core/HW/Memmap.h"

View File

@ -10,6 +10,7 @@
#include <mbedtls/md.h> #include <mbedtls/md.h>
#include <mbedtls/sha256.h> #include <mbedtls/sha256.h>
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"

View File

@ -12,6 +12,7 @@
#include <sys/select.h> #include <sys/select.h>
#endif #endif
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"

View File

@ -9,6 +9,7 @@
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/SDCardUtil.h" #include "Common/SDCardUtil.h"

View File

@ -10,7 +10,7 @@
#include <string> #include <string>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Core/IOS/Device.h" #include "Core/IOS/Device.h"
#include "Core/IOS/IOS.h" #include "Core/IOS/IOS.h"

View File

@ -10,6 +10,7 @@
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/SysConf.h" #include "Common/SysConf.h"

View File

@ -10,7 +10,6 @@
#include "Common/Assert.h" #include "Common/Assert.h"
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Common/NandPaths.h" #include "Common/NandPaths.h"

View File

@ -11,6 +11,7 @@
#include <vector> #include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Core/HW/Memmap.h" #include "Core/HW/Memmap.h"

View File

@ -8,6 +8,7 @@
#include <vector> #include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/NandPaths.h" #include "Common/NandPaths.h"

View File

@ -8,7 +8,7 @@
#include <vector> #include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Core/IOS/Device.h" #include "Core/IOS/Device.h"
#include "Core/IOS/IOS.h" #include "Core/IOS/IOS.h"
#include "DiscIO/Volume.h" #include "DiscIO/Volume.h"

View File

@ -21,11 +21,13 @@
#include "Common/Assert.h" #include "Common/Assert.h"
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Hash.h" #include "Common/Hash.h"
#include "Common/NandPaths.h" #include "Common/NandPaths.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
#include "Common/Timer.h" #include "Common/Timer.h"
#include "Core/Boot/Boot.h" #include "Core/Boot/Boot.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"
@ -45,8 +47,11 @@
#include "Core/NetPlayProto.h" #include "Core/NetPlayProto.h"
#include "Core/PowerPC/PowerPC.h" #include "Core/PowerPC/PowerPC.h"
#include "Core/State.h" #include "Core/State.h"
#include "DiscIO/Enums.h" #include "DiscIO/Enums.h"
#include "InputCommon/GCPadStatus.h" #include "InputCommon/GCPadStatus.h"
#include "VideoCommon/Fifo.h" #include "VideoCommon/Fifo.h"
#include "VideoCommon/VideoBackendBase.h" #include "VideoCommon/VideoBackendBase.h"
#include "VideoCommon/VideoConfig.h" #include "VideoCommon/VideoConfig.h"

View File

@ -13,7 +13,6 @@
#include <vector> #include <vector>
#include "Common/Assert.h" #include "Common/Assert.h"
#include "Common/FileUtil.h"
#include "Common/IniFile.h" #include "Common/IniFile.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"

View File

@ -13,7 +13,7 @@
#endif #endif
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MemoryUtil.h" #include "Common/MemoryUtil.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"

View File

@ -18,7 +18,7 @@
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Core/Core.h" #include "Core/Core.h"

View File

@ -8,7 +8,7 @@
#include <vector> #include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"

View File

@ -13,6 +13,7 @@
#include "Common/Assert.h" #include "Common/Assert.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"

View File

@ -6,6 +6,7 @@
#include <fstream> #include <fstream>
#include <sstream> #include <sstream>
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
@ -17,7 +18,7 @@ bool CSVSignatureDB::Load(const std::string& file_path)
{ {
std::string line; std::string line;
std::ifstream ifs; std::ifstream ifs;
OpenFStream(ifs, file_path, std::ios_base::in); File::OpenFStream(ifs, file_path, std::ios_base::in);
if (!ifs) if (!ifs)
return false; return false;

View File

@ -7,7 +7,7 @@
#include <string> #include <string>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Core/PowerPC/SignatureDB/DSYSignatureDB.h" #include "Core/PowerPC/SignatureDB/DSYSignatureDB.h"

View File

@ -128,7 +128,7 @@ void MEGASignatureDB::Clear()
bool MEGASignatureDB::Load(const std::string& file_path) bool MEGASignatureDB::Load(const std::string& file_path)
{ {
std::ifstream ifs; std::ifstream ifs;
OpenFStream(ifs, file_path, std::ios_base::in); File::OpenFStream(ifs, file_path, std::ios_base::in);
if (!ifs) if (!ifs)
return false; return false;

View File

@ -13,6 +13,7 @@
#include "Common/ChunkFile.h" #include "Common/ChunkFile.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Event.h" #include "Common/Event.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Common/ScopeGuard.h" #include "Common/ScopeGuard.h"

View File

@ -53,7 +53,7 @@ static bool LoadMap(const std::string& file_path, Map& map,
std::function<bool(const std::string& game_id)> predicate) std::function<bool(const std::string& game_id)> predicate)
{ {
std::ifstream txt; std::ifstream txt;
OpenFStream(txt, file_path, std::ios::in); File::OpenFStream(txt, file_path, std::ios::in);
if (!txt.is_open()) if (!txt.is_open())
return false; return false;

View File

@ -18,6 +18,7 @@
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Crypto/ec.h" #include "Common/Crypto/ec.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/Swap.h" #include "Common/Swap.h"

View File

@ -11,7 +11,7 @@
#include "Common/CDUtils.h" #include "Common/CDUtils.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "DiscIO/Blob.h" #include "DiscIO/Blob.h"
#include "DiscIO/CISOBlob.h" #include "DiscIO/CISOBlob.h"

View File

@ -18,6 +18,7 @@
#include <memory> #include <memory>
#include <optional> #include <optional>
#include <string> #include <string>
#include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Swap.h" #include "Common/Swap.h"

View File

@ -8,7 +8,7 @@
#include <utility> #include <utility>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "DiscIO/CISOBlob.h" #include "DiscIO/CISOBlob.h"
namespace DiscIO namespace DiscIO

View File

@ -9,7 +9,7 @@
#include <string> #include <string>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "DiscIO/Blob.h" #include "DiscIO/Blob.h"
namespace DiscIO namespace DiscIO

View File

@ -18,6 +18,7 @@
#include <zlib.h> #include <zlib.h>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Hash.h" #include "Common/Hash.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"

View File

@ -18,7 +18,7 @@
#include <vector> #include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "DiscIO/Blob.h" #include "DiscIO/Blob.h"
namespace DiscIO namespace DiscIO

View File

@ -12,7 +12,7 @@
#include <vector> #include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "DiscIO/DiscScrubber.h" #include "DiscIO/DiscScrubber.h"
#include "DiscIO/Filesystem.h" #include "DiscIO/Filesystem.h"

View File

@ -10,7 +10,7 @@
#include <vector> #include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "DiscIO/Blob.h" #include "DiscIO/Blob.h"

View File

@ -8,7 +8,7 @@
#include <string> #include <string>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "DiscIO/Blob.h" #include "DiscIO/Blob.h"
#ifdef _WIN32 #ifdef _WIN32

View File

@ -9,7 +9,7 @@
#include <string> #include <string>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "DiscIO/Blob.h" #include "DiscIO/Blob.h"
namespace DiscIO namespace DiscIO

View File

@ -14,7 +14,7 @@
#include "Common/CommonFuncs.h" #include "Common/CommonFuncs.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"

View File

@ -19,6 +19,7 @@
#include "Common/Align.h" #include "Common/Align.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/Crypto/AES.h" #include "Common/Crypto/AES.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"

View File

@ -9,6 +9,7 @@
#include <cstring> #include <cstring>
#include "Common/Crypto/AES.h" #include "Common/Crypto/AES.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"

View File

@ -8,7 +8,7 @@
#include <string> #include <string>
#include <utility> #include <utility>
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/Swap.h" #include "Common/Swap.h"
namespace namespace

View File

@ -9,7 +9,7 @@
#include <utility> #include <utility>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "DiscIO/Blob.h" #include "DiscIO/Blob.h"
namespace DiscIO namespace DiscIO

View File

@ -14,6 +14,7 @@
#include "Common/ColorUtil.h" #include "Common/ColorUtil.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/NandPaths.h" #include "Common/NandPaths.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
@ -43,13 +44,11 @@ std::vector<u32> Volume::GetWiiBanner(int* width, int* height, u64 title_id)
const std::string file_name = const std::string file_name =
Common::GetTitleDataPath(title_id, Common::FROM_CONFIGURED_ROOT) + "banner.bin"; Common::GetTitleDataPath(title_id, Common::FROM_CONFIGURED_ROOT) + "banner.bin";
if (!File::Exists(file_name))
return std::vector<u32>();
if (File::GetSize(file_name) < WII_BANNER_OFFSET + WII_BANNER_SIZE)
return std::vector<u32>();
File::IOFile file(file_name, "rb"); File::IOFile file(file_name, "rb");
if (file.GetSize() < WII_BANNER_OFFSET + WII_BANNER_SIZE)
return std::vector<u32>();
if (!file.Seek(WII_BANNER_OFFSET, SEEK_SET)) if (!file.Seek(WII_BANNER_OFFSET, SEEK_SET))
return std::vector<u32>(); return std::vector<u32>();

View File

@ -16,6 +16,7 @@
#include "Common/Assert.h" #include "Common/Assert.h"
#include "Common/CommonPaths.h" #include "Common/CommonPaths.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"

View File

@ -15,7 +15,7 @@
#include "Common/Align.h" #include "Common/Align.h"
#include "Common/Assert.h" #include "Common/Assert.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Common/Swap.h" #include "Common/Swap.h"

View File

@ -9,7 +9,7 @@
#include <vector> #include <vector>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h" #include "Common/File.h"
#include "DiscIO/Blob.h" #include "DiscIO/Blob.h"
namespace DiscIO namespace DiscIO

View File

@ -321,7 +321,7 @@ void CCodeWindow::OnSymbolsMenu(wxCommandEvent& event)
if (!path.IsEmpty()) if (!path.IsEmpty())
{ {
std::ifstream f; std::ifstream f;
OpenFStream(f, WxStrToStr(path), std::ios_base::in); File::OpenFStream(f, WxStrToStr(path), std::ios_base::in);
std::string line; std::string line;
while (std::getline(f, line)) while (std::getline(f, line))

View File

@ -22,6 +22,7 @@
#include <wx/utils.h> #include <wx/utils.h>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/File.h"
#include "Common/FileUtil.h" #include "Common/FileUtil.h"
#include "Common/IniFile.h" #include "Common/IniFile.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"

View File

@ -5,7 +5,6 @@
#include <wx/gdicmn.h> #include <wx/gdicmn.h>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/IniFile.h" #include "Common/IniFile.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
#include "DolphinWX/NetPlay/NetPlayLauncher.h" #include "DolphinWX/NetPlay/NetPlayLauncher.h"

View File

@ -54,7 +54,7 @@ bool CompileVertexShader(const std::string& code, D3DBlob** blob)
std::string filename = StringFromFormat("%sbad_vs_%04i.txt", std::string filename = StringFromFormat("%sbad_vs_%04i.txt",
File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++); File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++);
std::ofstream file; std::ofstream file;
OpenFStream(file, filename, std::ios_base::out); File::OpenFStream(file, filename, std::ios_base::out);
file << code; file << code;
file.close(); file.close();
@ -112,7 +112,7 @@ bool CompileGeometryShader(const std::string& code, D3DBlob** blob,
std::string filename = StringFromFormat("%sbad_gs_%04i.txt", std::string filename = StringFromFormat("%sbad_gs_%04i.txt",
File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++); File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++);
std::ofstream file; std::ofstream file;
OpenFStream(file, filename, std::ios_base::out); File::OpenFStream(file, filename, std::ios_base::out);
file << code; file << code;
file.close(); file.close();
@ -169,7 +169,7 @@ bool CompilePixelShader(const std::string& code, D3DBlob** blob, const D3D_SHADE
std::string filename = StringFromFormat("%sbad_ps_%04i.txt", std::string filename = StringFromFormat("%sbad_ps_%04i.txt",
File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++); File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++);
std::ofstream file; std::ofstream file;
OpenFStream(file, filename, std::ios_base::out); File::OpenFStream(file, filename, std::ios_base::out);
file << code; file << code;
file.close(); file.close();

View File

@ -15,7 +15,6 @@
#include <unordered_map> #include <unordered_map>
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MathUtil.h" #include "Common/MathUtil.h"

View File

@ -9,6 +9,7 @@
#include "Common/Align.h" #include "Common/Align.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/Logging/Log.h" #include "Common/Logging/Log.h"
#include "Common/MsgHandler.h" #include "Common/MsgHandler.h"
#include "Common/StringUtil.h" #include "Common/StringUtil.h"
@ -309,7 +310,7 @@ bool ProgramShaderCache::CompileShader(SHADER& shader, const std::string& vcode,
std::string filename = std::string filename =
StringFromFormat("%sbad_p_%d.txt", File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++); StringFromFormat("%sbad_p_%d.txt", File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++);
std::ofstream file; std::ofstream file;
OpenFStream(file, filename, std::ios_base::out); File::OpenFStream(file, filename, std::ios_base::out);
file << s_glsl_header << vcode << s_glsl_header << pcode; file << s_glsl_header << vcode << s_glsl_header << pcode;
if (!gcode.empty()) if (!gcode.empty())
file << s_glsl_header << gcode; file << s_glsl_header << gcode;
@ -380,7 +381,7 @@ bool ProgramShaderCache::CompileComputeShader(SHADER& shader, const std::string&
std::string filename = std::string filename =
StringFromFormat("%sbad_p_%d.txt", File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++); StringFromFormat("%sbad_p_%d.txt", File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++);
std::ofstream file; std::ofstream file;
OpenFStream(file, filename, std::ios_base::out); File::OpenFStream(file, filename, std::ios_base::out);
file << s_glsl_header << code; file << s_glsl_header << code;
file << info_log; file << info_log;
file.close(); file.close();
@ -447,7 +448,7 @@ GLuint ProgramShaderCache::CompileSingleShader(GLuint type, const std::string& c
std::string filename = StringFromFormat( std::string filename = StringFromFormat(
"%sbad_%s_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), prefix, num_failures++); "%sbad_%s_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), prefix, num_failures++);
std::ofstream file; std::ofstream file;
OpenFStream(file, filename, std::ios_base::out); File::OpenFStream(file, filename, std::ios_base::out);
file << s_glsl_header << code << info_log; file << s_glsl_header << code << info_log;
file.close(); file.close();

View File

@ -15,7 +15,6 @@
#include "Common/Atomic.h" #include "Common/Atomic.h"
#include "Common/CommonTypes.h" #include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/GL/GLInterfaceBase.h" #include "Common/GL/GLInterfaceBase.h"
#include "Common/GL/GLUtil.h" #include "Common/GL/GLUtil.h"
#include "Common/Logging/LogManager.h" #include "Common/Logging/LogManager.h"

View File

@ -179,13 +179,13 @@ void VertexManager::vFlush()
std::string filename = StringFromFormat( std::string filename = StringFromFormat(
"%sps%.3d.txt", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), g_ActiveConfig.iSaveTargetId); "%sps%.3d.txt", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), g_ActiveConfig.iSaveTargetId);
std::ofstream fps; std::ofstream fps;
OpenFStream(fps, filename, std::ios_base::out); File::OpenFStream(fps, filename, std::ios_base::out);
fps << prog.shader.strpprog; fps << prog.shader.strpprog;
filename = StringFromFormat("%svs%.3d.txt", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(), filename = StringFromFormat("%svs%.3d.txt", File::GetUserPath(D_DUMPFRAMES_IDX).c_str(),
g_ActiveConfig.iSaveTargetId); g_ActiveConfig.iSaveTargetId);
std::ofstream fvs; std::ofstream fvs;
OpenFStream(fvs, filename, std::ios_base::out); File::OpenFStream(fvs, filename, std::ios_base::out);
fvs << prog.shader.strvprog; fvs << prog.shader.strvprog;
} }
#endif #endif

Some files were not shown because too many files have changed in this diff Show More