IOFile: Add WriteString() method to replace fprintf string writing.
This commit is contained in:
parent
ee06963644
commit
9c590e215f
|
@ -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; }
|
||||||
|
|
Loading…
Reference in New Issue