1
0
Fork 0
mirror of https://github.com/thoughtbot/capybara-webkit synced 2023-03-27 23:22:28 -04:00
capybara-webkit/src/Response.cpp

36 lines
861 B
C++
Raw Normal View History

#include "Response.h"
2013-02-02 17:32:54 -05:00
#include "ErrorMessage.h"
#include <iostream>
Response::Response(bool success, QString message, QObject *parent) : QObject(parent) {
m_success = success;
m_message = message.toUtf8();
}
Response::Response(bool success, QByteArray message, QObject *parent) : QObject(parent) {
m_success = success;
m_message = message;
}
2013-02-02 17:32:54 -05:00
Response::Response(bool success, ErrorMessage *message, QObject *parent) : QObject(parent) {
m_success = success;
m_message = message->toString();
message->deleteLater();
}
Response::Response(bool success, QObject *parent) : QObject(parent) {
m_success = success;
}
bool Response::isSuccess() const {
return m_success;
}
QByteArray Response::message() const {
return m_message;
}
2012-07-11 23:36:22 -04:00
QString Response::toString() const {
return QString(m_success ? "Success(" : "Failure(") + m_message + ")";
}