Vidalia
0.2.21
Main Page
Namespaces
Classes
Files
File List
File Members
src
torcontrol
ControlReply.cpp
Go to the documentation of this file.
1
/*
2
** This file is part of Vidalia, and is subject to the license terms in the
3
** LICENSE file, found in the top level directory of this distribution. If
4
** you did not receive the LICENSE file with this file, you may obtain it
5
** from the Vidalia source package distributed by the Vidalia Project at
6
** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7
** including this file, may be copied, modified, propagated, or distributed
8
** except according to the terms described in the LICENSE file.
9
*/
10
11
/*
12
** \file ControlReply.cpp
13
** \brief A response from Tor's control interface
14
*/
15
16
#include "
ControlReply.h
"
17
18
19
/** Default constructor */
20
ControlReply::ControlReply
()
21
{
22
}
23
24
/** Add a line associated with this reply */
25
void
26
ControlReply::appendLine
(
ReplyLine
line)
27
{
28
_lines
<< line;
29
}
30
31
/** Returns the requested line from this reply */
32
ReplyLine
33
ControlReply::getLine
(
int
idx)
const
34
{
35
return
_lines
.at(idx);
36
}
37
38
/** Returns all lines for this reply */
39
QList<ReplyLine>
40
ControlReply::getLines
()
const
41
{
42
return
_lines
;
43
}
44
45
/** Returns the status of the first line in the reply */
46
QString
47
ControlReply::getStatus
()
const
48
{
49
return
getLine
().
getStatus
();
50
}
51
52
/** Returns the message of the first line in the reply */
53
QString
54
ControlReply::getMessage
()
const
55
{
56
return
getLine
().
getMessage
();
57
}
58
59
/** Returns the data for the first line in the reply. */
60
QStringList
61
ControlReply::getData
()
const
62
{
63
return
getLine
().
getData
();
64
}
65
66
/** Returns the entire contents of the control reply. */
67
QString
68
ControlReply::toString
()
const
69
{
70
QString str;
71
foreach
(
ReplyLine
line,
_lines
) {
72
str.append(line.
toString
());
73
str.append(
"\n"
);
74
}
75
return
str.trimmed();
76
}
77
Generated on Thu Dec 6 2012 04:33:16 for Vidalia by
1.8.2