#include <controlcommand.h>
Public Member Functions | |
ControlCommand () | |
ControlCommand (QString keyword) | |
ControlCommand (QString keyword, QString arg) | |
ControlCommand (QString keyword, QStringList args) | |
void | setKeyword (QString keyword) |
void | addArgument (QString arg) |
void | appendData (QString data) |
QString | toString () |
Private Member Functions | |
QString | escape (QString str) |
Private Attributes | |
QString | _keyword |
QStringList | _arguments |
QStringList | _data |
Definition at line 34 of file controlcommand.h.
ControlCommand::ControlCommand | ( | ) |
Default constructor.
Definition at line 32 of file controlcommand.cpp.
ControlCommand::ControlCommand | ( | QString | keyword | ) |
Creates a command using the specified keyword.
Definition at line 37 of file controlcommand.cpp.
References _keyword.
ControlCommand::ControlCommand | ( | QString | keyword, | |
QString | arg | |||
) |
Creates a control command using the specified keyword and argument.
Definition at line 43 of file controlcommand.cpp.
References _keyword, and addArgument().
ControlCommand::ControlCommand | ( | QString | keyword, | |
QStringList | args | |||
) |
Creates a control command using the specified keyword and list of arguments.
Definition at line 51 of file controlcommand.cpp.
References _arguments, and _keyword.
void ControlCommand::setKeyword | ( | QString | keyword | ) |
Set the keyword for this control command
Definition at line 59 of file controlcommand.cpp.
References _keyword.
void ControlCommand::addArgument | ( | QString | arg | ) |
Add an argument to this control command
Definition at line 66 of file controlcommand.cpp.
References _arguments.
Referenced by ControlCommand(), TorControl::getConf(), TorControl::getDescriptorListById(), TorControl::getDescriptorListByName(), TorControl::getInfo(), TorControl::resetConf(), TorControl::setConf(), TorControl::setEvents(), and TorControl::signal().
void ControlCommand::appendData | ( | QString | data | ) |
Append a data line for this control command
Definition at line 73 of file controlcommand.cpp.
References _data.
QString ControlCommand::toString | ( | ) |
Format this control command into a format conforming to Tor's v1 protocol specification.
Definition at line 101 of file controlcommand.cpp.
References _arguments, _data, _keyword, escape(), and i().
Referenced by ControlSocket::sendCommand().
QString ControlCommand::escape | ( | QString | str | ) | [private] |
Escape special characters in the supplied string
Definition at line 80 of file controlcommand.cpp.
Referenced by toString().
QString ControlCommand::_keyword [private] |
Definition at line 59 of file controlcommand.h.
Referenced by ControlCommand(), setKeyword(), and toString().
QStringList ControlCommand::_arguments [private] |
Definition at line 60 of file controlcommand.h.
Referenced by addArgument(), ControlCommand(), and toString().
QStringList ControlCommand::_data [private] |