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.

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, and addArgument().

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, and _keyword.


Member Function Documentation

void ControlCommand::addArgument ( const QString &  arg  ) 

Add an argument to this control command

Definition at line 55 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 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

Definition at line 71 of file controlcommand.cpp.

References _data.

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

Escape special characters in the supplied string

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 ControlConnection::send().

void ControlCommand::setKeyword ( const QString &  keyword  ) 

Set the keyword for this control command

Definition at line 48 of file controlcommand.cpp.

References _keyword.

QString ControlCommand::toString (  )  const

Format this control command into a format conforming to Tor's v1 protocol specification.

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:
Generated on Tue Jul 7 16:58:12 2009 for Vidalia by  doxygen 1.4.7