serverstatusevent.cpp

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 serverstatusevent.cpp
00013 ** \version $Id: serverstatusevent.cpp 2362 2008-02-29 04:30:11Z edmanm $
00014 ** \brief Base class for all Tor server status events
00015 */
00016 
00017 #include "serverstatusevent.h"
00018 
00019 
00020 /** Returns a ServerStatusEvent::Status enum value for the server status
00021  * represented by <b>str</b>. */
00022 ServerStatusEvent::Status
00023 ServerStatusEvent::statusFromString(const QString &str)
00024 {
00025   if (!str.compare("EXTERNAL_ADDRESS", Qt::CaseInsensitive))
00026     return ExternalAddressChanged;
00027   if (!str.compare("CHECKING_REACHABILITY", Qt::CaseInsensitive))
00028     return CheckingReachability;
00029   if (!str.compare("REACHABILITY_SUCCEEDED", Qt::CaseInsensitive))
00030     return ReachabilitySucceeded;
00031   if (!str.compare("GOOD_SERVER_DESCRIPTOR", Qt::CaseInsensitive))
00032     return GoodServerDescriptor;
00033   if (!str.compare("NAMESERVER_STATUS", Qt::CaseInsensitive))
00034     return NameserverStatusChanged;
00035   if (!str.compare("NAMESERVER_ALL_DOWN", Qt::CaseInsensitive))
00036     return NameserversAllDown;
00037   if (!str.compare("DNS_HIJACKED", Qt::CaseInsensitive))
00038     return DnsHijacked;
00039   if (!str.compare("DNS_USELESS", Qt::CaseInsensitive))
00040     return DnsUseless;
00041   if (!str.compare("BAD_SERVER_DESCRIPTOR", Qt::CaseInsensitive))
00042     return RejectedServerDescriptor;
00043   if (!str.compare("ACCEPTED_SERVER_DESCRIPTOR", Qt::CaseInsensitive))
00044     return AcceptedServerDescriptor;
00045   if (!str.compare("REACHABILITY_FAILED", Qt::CaseInsensitive))
00046     return ReachabilityFailed;
00047   return UnrecognizedStatus;
00048 }
00049 

Generated on Tue Jul 7 16:58:26 2009 for Vidalia by  doxygen 1.4.7