mirror of
https://github.com/libAthena/athena.git
synced 2025-07-12 08:05:56 +00:00
Remove rest of fmt
This commit is contained in:
parent
e0fbcfee7e
commit
5a416eec41
@ -42,7 +42,7 @@ void FileReader::open() {
|
||||
m_fileHandle = 0;
|
||||
std::string _filename = filename();
|
||||
if (m_globalErr)
|
||||
atError(FMT_STRING("File not found '{}'"), _filename);
|
||||
atError("File not found '{}'") _filename);
|
||||
setError();
|
||||
return;
|
||||
}
|
||||
@ -54,7 +54,7 @@ void FileReader::open() {
|
||||
void FileReader::close() {
|
||||
if (!m_fileHandle) {
|
||||
if (m_globalErr)
|
||||
atError(FMT_STRING("Cannot close an unopened stream"));
|
||||
atError("Cannot close an unopened stream");
|
||||
setError();
|
||||
return;
|
||||
}
|
||||
@ -85,7 +85,7 @@ void FileReader::seek(atInt64 pos, SeekOrigin origin) {
|
||||
if (m_offset > length()) {
|
||||
oldOff = m_offset;
|
||||
if (m_globalErr)
|
||||
atError(FMT_STRING("Unable to seek in file"));
|
||||
atError("Unable to seek in file");
|
||||
setError();
|
||||
return;
|
||||
}
|
||||
@ -104,7 +104,7 @@ void FileReader::seek(atInt64 pos, SeekOrigin origin) {
|
||||
li.QuadPart = pos;
|
||||
if (!SetFilePointerEx(m_fileHandle, li, nullptr, DWORD(origin))) {
|
||||
if (m_globalErr)
|
||||
atError(FMT_STRING("Unable to seek in file"));
|
||||
atError("Unable to seek in file");
|
||||
setError();
|
||||
}
|
||||
}
|
||||
@ -113,7 +113,7 @@ void FileReader::seek(atInt64 pos, SeekOrigin origin) {
|
||||
atUint64 FileReader::position() const {
|
||||
if (!isOpen()) {
|
||||
if (m_globalErr)
|
||||
atError(FMT_STRING("File not open"));
|
||||
atError("File not open");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ atUint64 FileReader::position() const {
|
||||
atUint64 FileReader::length() const {
|
||||
if (!isOpen()) {
|
||||
if (m_globalErr)
|
||||
atError(FMT_STRING("File not open"));
|
||||
atError("File not open");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -142,7 +142,7 @@ atUint64 FileReader::length() const {
|
||||
atUint64 FileReader::readUBytesToBuf(void* buf, atUint64 len) {
|
||||
if (!isOpen()) {
|
||||
if (m_globalErr)
|
||||
atError(FMT_STRING("File not open for reading"));
|
||||
atError("File not open for reading");
|
||||
setError();
|
||||
return 0;
|
||||
}
|
||||
|
@ -49,7 +49,7 @@ void FileWriter::open(bool overwrite) {
|
||||
if (m_fileHandle == INVALID_HANDLE_VALUE) {
|
||||
m_fileHandle = 0;
|
||||
if (m_globalErr)
|
||||
atError(FMT_STRING("Unable to open file '{}'"), filename());
|
||||
atError("Unable to open file '{}'", filename());
|
||||
setError();
|
||||
return;
|
||||
}
|
||||
@ -61,7 +61,7 @@ void FileWriter::open(bool overwrite) {
|
||||
void FileWriter::close() {
|
||||
if (!m_fileHandle) {
|
||||
if (m_globalErr)
|
||||
atError(FMT_STRING("Cannot close an unopened stream"));
|
||||
atError("Cannot close an unopened stream");
|
||||
setError();
|
||||
return;
|
||||
}
|
||||
@ -77,7 +77,7 @@ void FileWriter::close() {
|
||||
void FileWriter::seek(atInt64 pos, SeekOrigin origin) {
|
||||
if (!isOpen()) {
|
||||
if (m_globalErr)
|
||||
atError(FMT_STRING("Unable to seek in file, not open"));
|
||||
atError("Unable to seek in file, not open");
|
||||
setError();
|
||||
return;
|
||||
}
|
||||
@ -86,7 +86,7 @@ void FileWriter::seek(atInt64 pos, SeekOrigin origin) {
|
||||
li.QuadPart = pos;
|
||||
if (!SetFilePointerEx(m_fileHandle, li, nullptr, DWORD(origin))) {
|
||||
if (m_globalErr)
|
||||
atError(FMT_STRING("Unable to seek in file"));
|
||||
atError("Unable to seek in file");
|
||||
setError();
|
||||
}
|
||||
}
|
||||
@ -103,7 +103,7 @@ atUint64 FileWriter::length() const { return utility::fileSize(m_filename); }
|
||||
void FileWriter::writeUBytes(const atUint8* data, atUint64 len) {
|
||||
if (!isOpen()) {
|
||||
if (m_globalErr) {
|
||||
atError(FMT_STRING("File not open for writing"));
|
||||
atError("File not open for writing");
|
||||
}
|
||||
setError();
|
||||
return;
|
||||
@ -116,7 +116,7 @@ void FileWriter::writeUBytes(const atUint8* data, atUint64 len) {
|
||||
|
||||
if (WriteFile(m_fileHandle, data, toWrite, &written, nullptr) == FALSE) {
|
||||
if (m_globalErr) {
|
||||
atError(FMT_STRING("Unable to write to file"));
|
||||
atError("Unable to write to file");
|
||||
}
|
||||
setError();
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user