Vidalia 0.2.12

ControlReply.h

Go to the documentation of this file.
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 ** \brief A response from Tor's control interface
00014 */
00015 
00016 #ifndef _CONTROLREPLY_H
00017 #define _CONTROLREPLY_H
00018 
00019 #include "ReplyLine.h"
00020 
00021 #include <QStringList>
00022 
00023 
00024 class ControlReply
00025 {
00026 public:
00027   /** Default constructor */
00028   ControlReply();
00029 
00030   /** Add a line associated with this reply */
00031   void appendLine(ReplyLine line);
00032 
00033   /** Returns a single line from this reply */
00034   ReplyLine getLine(int idx = 0) const;
00035   /** Returns all lines for this reply */
00036   QList<ReplyLine> getLines() const;
00037   
00038   /** Returns the status of the first line in the reply */
00039   QString getStatus() const;
00040   /** Returns the messasge of the first line in the reply */
00041   QString getMessage() const;
00042   /** Returns the data for the first line in the reply. */
00043   QStringList getData() const;
00044   /** Returns the entire contents of the control reply. */
00045   QString toString() const;
00046 
00047 private:
00048   QList<ReplyLine> _lines;
00049 };
00050 
00051 #endif
00052