Vidalia 0.3.1
|
#include <ControlCommand.h>
Public Member Functions | |
ControlCommand () | |
ControlCommand (const QString &keyword) | |
ControlCommand (const QString &keyword, const QString &arg) | |
ControlCommand (const QString &keyword, const QStringList &args) | |
QString | keyword () const |
void | setKeyword (const QString &keyword) |
void | addArgument (const QString &arg) |
void | addArguments (const QStringList &args) |
void | appendData (const QString &data) |
QString | toString () const |
Private Member Functions | |
QString | escape (const QString &str) const |
Private Attributes | |
QString | _keyword |
QStringList | _arguments |
QStringList | _data |
Definition at line 22 of file ControlCommand.h.
ControlCommand::ControlCommand | ( | ) |
Default constructor.
Definition at line 20 of file ControlCommand.cpp.
ControlCommand::ControlCommand | ( | const QString & | keyword | ) |
Creates a command using the specified keyword.
Definition at line 25 of file ControlCommand.cpp.
ControlCommand::ControlCommand | ( | const QString & | keyword, |
const QString & | arg | ||
) |
Creates a control command using the specified keyword and argument.
Definition at line 31 of file ControlCommand.cpp.
References _keyword, addArgument(), and keyword().
ControlCommand::ControlCommand | ( | const QString & | keyword, |
const QStringList & | args | ||
) |
Creates a control command using the specified keyword and list of arguments.
Definition at line 39 of file ControlCommand.cpp.
References _arguments, _keyword, and keyword().
void ControlCommand::addArgument | ( | const QString & | arg | ) |
Add an argument to this control command
Adds an argument to this command's argument list.
Definition at line 54 of file ControlCommand.cpp.
References _arguments.
Referenced by addArguments(), TorControl::closeCircuit(), TorControl::closeStream(), ControlCommand(), TorControl::getConf(), TorControl::getHiddenServiceConf(), TorControl::getInfo(), TorControl::resetConf(), TorControl::setConf(), TorControl::setEvents(), and TorControl::signal().
void ControlCommand::addArguments | ( | const QStringList & | args | ) |
Adds all arguments in args to this control command.
Definition at line 61 of file ControlCommand.cpp.
References addArgument().
Referenced by TorControl::getConf(), and TorControl::getInfo().
void ControlCommand::appendData | ( | const QString & | data | ) |
Append a data line for this control command
Adds data to the end of this command.
Definition at line 70 of file ControlCommand.cpp.
References _data.
|
private |
Escape special characters in the supplied string
Escapes any special characters in this command.
Definition at line 77 of file ControlCommand.cpp.
Referenced by toString().
|
inline |
Returns the keyword for this control command.
Definition at line 31 of file ControlCommand.h.
References _keyword.
Referenced by ControlCommand(), ControlConnection::send(), and setKeyword().
void ControlCommand::setKeyword | ( | const QString & | keyword | ) |
Set the keyword for this control command
Sets the keyword for this command.
Definition at line 47 of file ControlCommand.cpp.
QString ControlCommand::toString | ( | ) | const |
Format this control command into a format conforming to Tor's v1 protocol specification.
Formats a command according to Tor's Control Protocol V1. The proper format of a command is as follows:
Command = Keyword Arguments CRLF / "+" Keyword Arguments CRLF Data Keyword = 1*ALPHA Arguments = *(SP / VCHAR)
Definition at line 99 of file ControlCommand.cpp.
References _arguments, _data, _keyword, escape(), and i().
Referenced by ControlSocket::sendCommand().
|
private |
Definition at line 53 of file ControlCommand.h.
Referenced by addArgument(), ControlCommand(), and toString().
|
private |
Definition at line 54 of file ControlCommand.h.
Referenced by appendData(), and toString().
|
private |
Definition at line 52 of file ControlCommand.h.
Referenced by ControlCommand(), keyword(), setKeyword(), and toString().