00001 /* 00002 ** This file is part of Vidalia, and is subject to the license terms in the 00003 ** LICENSE file, found in the top level directory of this distribution. If 00004 ** you did not receive the LICENSE file with this file, you may obtain it 00005 ** from the Vidalia source package distributed by the Vidalia Project at 00006 ** http://www.vidalia-project.net/. No part of Vidalia, including this file, 00007 ** may be copied, modified, propagated, or distributed except according to 00008 ** the terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file controlreply.h 00013 ** \version $Id: controlreply.h 2362 2008-02-29 04:30:11Z edmanm $ 00014 ** \brief A response from Tor's control interface 00015 */ 00016 00017 #ifndef _CONTROLREPLY_H 00018 #define _CONTROLREPLY_H 00019 00020 #include <QStringList> 00021 00022 #include "replyline.h" 00023 00024 00025 class ControlReply 00026 { 00027 public: 00028 /** Default constructor */ 00029 ControlReply(); 00030 00031 /** Add a line associated with this reply */ 00032 void appendLine(ReplyLine line); 00033 00034 /** Returns a single line from this reply */ 00035 ReplyLine getLine(int idx = 0) const; 00036 /** Returns all lines for this reply */ 00037 QList<ReplyLine> getLines() const; 00038 00039 /** Returns the status of the first line in the reply */ 00040 QString getStatus() const; 00041 /** Returns the messasge of the first line in the reply */ 00042 QString getMessage() const; 00043 /** Returns the data for the first line in the reply. */ 00044 QStringList getData() const; 00045 /** Returns the entire contents of the control reply. */ 00046 QString toString() const; 00047 00048 private: 00049 QList<ReplyLine> _lines; 00050 }; 00051 00052 #endif 00053