Vidalia 0.2.10
Public Member Functions | Private Member Functions | Private Attributes

ControlCommand Class Reference

#include <ControlCommand.h>

List of all members.

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

Detailed Description

Definition at line 23 of file ControlCommand.h.


Constructor & Destructor Documentation

ControlCommand::ControlCommand ( )

Default constructor.

Definition at line 21 of file ControlCommand.cpp.

ControlCommand::ControlCommand ( const QString &  keyword)

Creates a command using the specified keyword.

Definition at line 26 of file ControlCommand.cpp.

References _keyword, and keyword().

ControlCommand::ControlCommand ( const QString &  keyword,
const QString &  arg 
)

Creates a control command using the specified keyword and argument.

Definition at line 32 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 40 of file ControlCommand.cpp.

References _arguments, _keyword, and keyword().


Member Function Documentation

void ControlCommand::addArgument ( const QString &  arg)
void ControlCommand::addArguments ( const QStringList &  args)

Adds all arguments in args to this control command.

Definition at line 62 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 71 of file ControlCommand.cpp.

References _data.

QString ControlCommand::escape ( const QString &  unescaped) const [private]

Escape special characters in the supplied string

Escapes any special characters in this command.

Definition at line 78 of file ControlCommand.cpp.

Referenced by toString().

QString ControlCommand::keyword ( ) const [inline]

Returns the keyword for this control command.

Definition at line 32 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 48 of file ControlCommand.cpp.

References _keyword, and keyword().

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 100 of file ControlCommand.cpp.

References _arguments, _data, _keyword, escape(), and i().

Referenced by ControlSocket::sendCommand().


Member Data Documentation

QStringList ControlCommand::_arguments [private]

Definition at line 54 of file ControlCommand.h.

Referenced by addArgument(), ControlCommand(), and toString().

QStringList ControlCommand::_data [private]

Definition at line 55 of file ControlCommand.h.

Referenced by appendData(), and toString().

QString ControlCommand::_keyword [private]

Definition at line 53 of file ControlCommand.h.

Referenced by ControlCommand(), keyword(), setKeyword(), and toString().


The documentation for this class was generated from the following files: