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.

Definition at line 30 of file torprocess.cpp.

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


Member Function Documentation

void TorProcess::closeStdout (  ) 

Disable reading log messages from stdout.

Definition at line 138 of file torprocess.cpp.

References onReadyRead().

Referenced by TorControl::closeTorStdout(), and TorControl::setLogEvents().

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

Formats the Tor process arguments for logging.

Definition at line 42 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.

Definition at line 170 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 148 of file torprocess.cpp.

References i(), and log().

Referenced by closeStdout(), and TorProcess().

void TorProcess::openStdout (  ) 

Enable reading log messages from stdout.

Definition at line 129 of file torprocess.cpp.

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

quint64 TorProcess::pid (  ) 

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

Definition at line 117 of file torprocess.cpp.

Referenced by stop().

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

Start the Tor process

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

Definition at line 85 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 184 of file torprocess.cpp.


The documentation for this class was generated from the following files:
Generated on Tue Jul 7 17:00:57 2009 for Vidalia by  doxygen 1.4.7