mirror of https://github.com/libAthena/athena.git
* Add formattedMessage to Exception
* Add missing IStreamWriter::fill implementations in FileWriter
This commit is contained in:
parent
77c58243b0
commit
8386fa54a0
|
@ -71,6 +71,11 @@ public:
|
||||||
{
|
{
|
||||||
return m_line;
|
return m_line;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline std::string formattedMessage() const
|
||||||
|
{
|
||||||
|
return Athena::utility::sprintf("%s : %s (%i) %s", m_file.c_str(), m_function.c_str(), m_line, m_message.c_str());
|
||||||
|
}
|
||||||
protected:
|
protected:
|
||||||
std::string m_message; //!< The error message string
|
std::string m_message; //!< The error message string
|
||||||
std::string m_file;
|
std::string m_file;
|
||||||
|
|
|
@ -59,6 +59,8 @@ public:
|
||||||
void writeBool (bool val);
|
void writeBool (bool val);
|
||||||
void writeString(const std::string& val);
|
void writeString(const std::string& val);
|
||||||
void writeUnicode(const std::string& str);
|
void writeUnicode(const std::string& str);
|
||||||
|
void fill(atInt8 byte, atUint64 len);
|
||||||
|
void fill(atUint8 byte, atUint64 len);
|
||||||
private:
|
private:
|
||||||
std::string m_filename;
|
std::string m_filename;
|
||||||
FILE* m_fileHandle;
|
FILE* m_fileHandle;
|
||||||
|
|
|
@ -306,5 +306,18 @@ void FileWriter::writeUnicode(const std::string& str)
|
||||||
writeInt16(chr);
|
writeInt16(chr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void FileWriter::fill(atInt8 byte, atUint64 len)
|
||||||
|
{
|
||||||
|
if (!isOpen())
|
||||||
|
THROW_INVALID_OPERATION_EXCEPTION("File not open for writing");
|
||||||
|
fwrite(&byte, 1, len, m_fileHandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FileWriter::fill(atUint8 byte, atUint64 len)
|
||||||
|
{
|
||||||
|
fill((atInt8)byte, len);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} // Athena
|
} // Athena
|
||||||
|
|
Loading…
Reference in New Issue