2018-06-26 14:09:39 +02:00
|
|
|
#include "Command.hpp"
|
2018-04-30 23:30:05 +02:00
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
// command
|
|
|
|
Command::Command(const QString &_text)
|
|
|
|
{
|
|
|
|
int index = _text.indexOf(' ');
|
|
|
|
|
|
|
|
if (index == -1) {
|
|
|
|
this->name = _text;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2018-05-06 00:32:45 +02:00
|
|
|
this->name = _text.mid(0, index).trimmed();
|
|
|
|
this->func = _text.mid(index + 1).trimmed();
|
2018-04-30 23:30:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
Command::Command(const QString &_name, const QString &_func)
|
2018-05-06 00:32:45 +02:00
|
|
|
: name(_name.trimmed())
|
|
|
|
, func(_func.trimmed())
|
2018-04-30 23:30:05 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QString Command::toString() const
|
|
|
|
{
|
|
|
|
return this->name + " " + this->func;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace chatterino
|