Vidalia  0.2.21
Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
ReplyLine Class Reference

#include <ReplyLine.h>

Public Member Functions

 ReplyLine ()
 
 ReplyLine (const QString &status, const QString &message)
 
 ReplyLine (const QString &status, const QString &message, const QString &data)
 
void setStatus (const QString &status)
 
QString getStatus () const
 
void setMessage (const QString &msg)
 
QString getMessage () const
 
void appendData (const QString &data)
 
QStringList getData () const
 
bool hasData () const
 
QString toString () const
 

Static Private Member Functions

static QString unescape (const QString &escaped)
 

Private Attributes

QString _status
 
QString _message
 
QStringList _data
 

Detailed Description

Definition at line 22 of file ReplyLine.h.

Constructor & Destructor Documentation

ReplyLine::ReplyLine ( )

Default constructor

Definition at line 20 of file ReplyLine.cpp.

ReplyLine::ReplyLine ( const QString &  status,
const QString &  msg 
)

Constructor

Definition at line 25 of file ReplyLine.cpp.

References _status, and setMessage().

ReplyLine::ReplyLine ( const QString &  status,
const QString &  msg,
const QString &  data 
)

Constructor

Definition at line 32 of file ReplyLine.cpp.

References _status, appendData(), and setMessage().

Member Function Documentation

void ReplyLine::appendData ( const QString &  data)

Appends data to this reply line.

Definition at line 71 of file ReplyLine.cpp.

References _data, and unescape().

Referenced by ControlSocket::readReply(), and ReplyLine().

QStringList ReplyLine::getData ( ) const

Returns a QStringList of all data lines for this reply line.

Returns a QStringList of all data lines for this reply line

Definition at line 78 of file ReplyLine.cpp.

References _data.

Referenced by ControlReply::getData(), TorControl::getInfo(), and TorEvents::handleLogMessage().

QString ReplyLine::getMessage ( ) const
QString ReplyLine::getStatus ( ) const

Returns the status code for this reply line.

Definition at line 50 of file ReplyLine.cpp.

References _status.

Referenced by ControlReply::getStatus(), and TorControl::protocolInfo().

bool ReplyLine::hasData ( ) const
inline

Returns true if this reply contained a data portion.

Definition at line 44 of file ReplyLine.h.

References _data.

Referenced by TorControl::getInfo().

void ReplyLine::setMessage ( const QString &  msg)

Sets the ReplyText message this reply line to msg.

Definition at line 57 of file ReplyLine.cpp.

References _message, and unescape().

Referenced by ReplyLine().

void ReplyLine::setStatus ( const QString &  status)

Set the status code to status.

Set the status code for this reply line. See Tor Control Protocol V1 specification for a description of status codes.

Definition at line 43 of file ReplyLine.cpp.

References _status.

QString ReplyLine::toString ( ) const

Returns the entire contents of this reply line, including the status, message, and any extra data.

Definition at line 99 of file ReplyLine.cpp.

References _data, _message, and _status.

Referenced by ControlReply::toString().

QString ReplyLine::unescape ( const QString &  escaped)
staticprivate

Unescapes special characters in str and returns the unescaped result.

Definition at line 86 of file ReplyLine.cpp.

Referenced by appendData(), and setMessage().

Member Data Documentation

QStringList ReplyLine::_data
private

Contents of any DataReplyLines in this line.

Definition at line 57 of file ReplyLine.h.

Referenced by appendData(), getData(), hasData(), and toString().

QString ReplyLine::_message
private

ReplyText portion of this reply line.

Definition at line 56 of file ReplyLine.h.

Referenced by getMessage(), setMessage(), and toString().

QString ReplyLine::_status
private

Response status code.

Definition at line 55 of file ReplyLine.h.

Referenced by getStatus(), ReplyLine(), setStatus(), and toString().


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