diff options
author | Karel Kočí <cynerd@email.cz> | 2017-09-02 15:34:07 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2017-09-02 15:34:07 +0200 |
commit | 375607d9969896c894fa2642ce4a0b8b519a2adb (patch) | |
tree | cb947a843d85f1cd278da15cff432c849986166c /qtmips_machine/qtmipsexception.cpp | |
parent | 82884b3ef726889f837542d2b5e98e2cd8246c00 (diff) | |
download | qtmips-375607d9969896c894fa2642ce4a0b8b519a2adb.tar.gz qtmips-375607d9969896c894fa2642ce4a0b8b519a2adb.tar.bz2 qtmips-375607d9969896c894fa2642ce4a0b8b519a2adb.zip |
Use QString and QVector instead of std ones and more
Diffstat (limited to 'qtmips_machine/qtmipsexception.cpp')
-rw-r--r-- | qtmips_machine/qtmipsexception.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/qtmips_machine/qtmipsexception.cpp b/qtmips_machine/qtmipsexception.cpp index 2ce7ae5..4cec6b0 100644 --- a/qtmips_machine/qtmipsexception.cpp +++ b/qtmips_machine/qtmipsexception.cpp @@ -10,19 +10,19 @@ QtMipsException::QtMipsException(QTMIPS_ARGS_COMMON) { } const char *QtMipsException::what() const throw() { - std::string message = this->msg(true); + QString message = this->msg(true); char * cstr = new char [message.length()+1]; - std::strcpy (cstr, message.c_str()); + std::strcpy (cstr, message.toStdString().c_str()); return cstr; } -std::string QtMipsException::msg(bool pos) const { - std::string message; +QString QtMipsException::msg(bool pos) const { + QString message; if (pos) - message += std::string("(") + std::string(this->file) + std::string(":") + std::to_string(this->line) + std::string(") "); + message += QString("(") + QString(this->file) + QString(":") + QString(this->line) + QString(") "); message += this->reason; - if (!this->ext.empty()) { - message += std::string(": "); + if (!this->ext.isEmpty()) { + message += QString(": "); message += this->ext; } return message; |