TorProcess Class Reference

#include <TorProcess.h>

List of all members.

Signals

void log (const QString &severity, const QString &message)
void startFailed (const QString &errorMessage)

Public Member Functions

 TorProcess (QObject *parent=0)
void start (const QString &app, const QStringList &args)
bool stop (QString *errmsg=0)
quint64 pid ()
void openStdout ()
void closeStdout ()

Static Public Member Functions

static QString version (const QString &exe)

Private Slots

void onReadyRead ()
void onError (QProcess::ProcessError error)

Private Member Functions

QString formatArguments (const QStringList &args)

Detailed Description

Definition at line 23 of file TorProcess.h.


Constructor & Destructor Documentation

TorProcess::TorProcess ( QObject *  parent = 0  ) 

Default constructor.

Default constructor

Definition at line 31 of file TorProcess.cpp.

References tc::error(), onError(), onReadyRead(), and openStdout().


Member Function Documentation

void TorProcess::closeStdout (  ) 

Disable reading log messages from stdout.

Closes logging on stdout. When this is closed, the log() signal will not be emitted when Tor prints a message to stdout.

Definition at line 139 of file TorProcess.cpp.

References onReadyRead().

Referenced by TorControl::closeTorStdout().

QString TorProcess::formatArguments ( const QStringList &  args  )  [private]

Formats the Tor process arguments for logging.

Definition at line 43 of file TorProcess.cpp.

References string_escape().

Referenced by start().

void TorProcess::log ( const QString &  severity,
const QString &  message 
) [signal]

Emitted when Tor prints a log message to the console

Referenced by onReadyRead().

void TorProcess::onError ( QProcess::ProcessError  error  )  [private, slot]

Called when an error occurs in the process.

Called when the process encounters an error. If the error tells us that the process failed to start, then we will emit the startFailed() signal and an error message indicating why.

Definition at line 171 of file TorProcess.cpp.

References tc::error(), and startFailed().

Referenced by TorProcess().

void TorProcess::onReadyRead (  )  [private, slot]

Called when there is data to be read from stdout

Definition at line 149 of file TorProcess.cpp.

References i(), and log().

Referenced by closeStdout(), and TorProcess().

void TorProcess::openStdout (  ) 

Enable reading log messages from stdout.

Opens logging on stdout. When this is open, the log() signal will be emitted when Tor prints a message to stdout.

Definition at line 130 of file TorProcess.cpp.

Referenced by TorControl::onDisconnected(), and TorProcess().

quint64 TorProcess::pid (  ) 

Return the Tor process's PID (workaround for some Windows funkiness)

Return the process ID for the current process.

Definition at line 118 of file TorProcess.cpp.

Referenced by stop().

void TorProcess::start ( const QString &  app,
const QStringList &  args 
)

Start the Tor process

Attempts to start the Tor process using the location, executable, and command-line arguments specified in Vidalia's settings. If Tor starts, the signal started() will be emitted. If Tor fails to start, startFailed(errmsg) will be emitted, with an appropriate error message.

Definition at line 57 of file TorProcess.cpp.

References tc::debug(), formatArguments(), and i().

Referenced by TorControl::start().

void TorProcess::startFailed ( const QString &  errorMessage  )  [signal]

Emitted when Tor fails to start, perhaps because the path to Tor was bogus.

Referenced by onError().

bool TorProcess::stop ( QString *  errmsg = 0  ) 

Stop the Tor process

Stops the Tor process

Definition at line 86 of file TorProcess.cpp.

References tc::debug(), tc::error(), and pid().

Referenced by TorControl::stop().

QString TorProcess::version ( const QString &  exe  )  [static]

Returns the version reported by the Tor executable specified in exe, or a default-constructed QString on failure.

Definition at line 185 of file TorProcess.cpp.


The documentation for this class was generated from the following files:
Generated on Mon Aug 30 23:09:55 2010 for Vidalia by  doxygen 1.6.3