Vidalia  0.3.1
TorSignal.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 TorSignal.cpp
13 ** \brief Sends a signal to Tor's control interface
14 */
15 
16 #include "TorSignal.h"
17 
18 
19 /** Returns a string representation of a signal that Tor understands. */
20 QString
22 {
23  QString sigtype;
24  switch (signal) {
25  case Reload: sigtype = "RELOAD"; break;
26  case Shutdown: sigtype = "SHUTDOWN"; break;
27  case Dump: sigtype = "DUMP"; break;
28  case Debug: sigtype = "DEBUG"; break;
29  case Halt: sigtype = "HALT"; break;
30  case NewNym: sigtype = "NEWNYM"; break;
31  default: return "UNKNOWN";
32  }
33  return sigtype;
34 }
35