controlreply.h

Go to the documentation of this file.
00001 /****************************************************************
00002  *  Vidalia is distributed under the following license:
00003  *
00004  *  Copyright (C) 2006,  Matt Edman, Justin Hipple
00005  *
00006  *  This program is free software; you can redistribute it and/or
00007  *  modify it under the terms of the GNU General Public License
00008  *  as published by the Free Software Foundation; either version 2
00009  *  of the License, or (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, 
00019  *  Boston, MA  02110-1301, USA.
00020  ****************************************************************/
00021 
00022 /** 
00023  * \file controlreply.h
00024  * \version $Id: controlreply.h 1735 2007-05-13 07:23:57Z edmanm $
00025  * \brief A response from Tor's control interface
00026  */
00027 
00028 #ifndef _CONTROLREPLY_H
00029 #define _CONTROLREPLY_H
00030 
00031 #include <QStringList>
00032 
00033 #include "replyline.h"
00034 
00035 class ControlReply
00036 {
00037 public:
00038   /** Default constructor */
00039   ControlReply();
00040 
00041   /** Add a line associated with this reply */
00042   void appendLine(ReplyLine line);
00043 
00044   /** Returns a single line from this reply */
00045   ReplyLine getLine(int idx = 0) const;
00046   /** Returns all lines for this reply */
00047   QList<ReplyLine> getLines() const;
00048   
00049   /** Returns the status of the first line in the reply */
00050   QString getStatus() const;
00051   /** Returns the messasge of the first line in the reply */
00052   QString getMessage() const;
00053   /** Returns the data for the first line in the reply. */
00054   QStringList getData() const;
00055   /** Returns the entire contents of the control reply. */
00056   QString toString() const;
00057 
00058 private:
00059   QList<ReplyLine> _lines;
00060 };
00061 
00062 #endif
00063 

Generated on Wed Sep 5 15:49:27 2007 for Vidalia by  doxygen 1.5.3