mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
IOFile: Add WriteString() method to replace fprintf string writing.
This commit is contained in:
@ -7,6 +7,7 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <string_view>
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
|
|
||||||
@ -67,6 +68,8 @@ public:
|
|||||||
return WriteArray(reinterpret_cast<const char*>(data), length);
|
return WriteArray(reinterpret_cast<const char*>(data), length);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WriteString(std::string_view str) { return WriteBytes(str.data(), str.size()); }
|
||||||
|
|
||||||
bool IsOpen() const { return nullptr != m_file; }
|
bool IsOpen() const { return nullptr != m_file; }
|
||||||
// m_good is set to false when a read, write or other function fails
|
// m_good is set to false when a read, write or other function fails
|
||||||
bool IsGood() const { return m_good; }
|
bool IsGood() const { return m_good; }
|
||||||
|
Reference in New Issue
Block a user