ircproxy The Ultimate Cyborg |
00001 // ircproxy -- An intelligent IRC proxy 00002 // 00003 //! @file ISupport.h 00004 //! @brief Header of class ISupport 00005 // 00006 // Copyright (C) 2007 by 00007 // 00008 // Carlo Wood, Run on IRC <carlo@alinoe.com> 00009 // RSA-1024 0x624ACAD5 1997-01-26 Sign & Encrypt 00010 // Fingerprint16 = 32 EC A7 B6 AC DB 65 A6 F6 F6 55 DD 1C DC FF 61 00011 // 00012 // This file may be distributed under the terms of the Q Public License 00013 // version 1.0 as appearing in the file LICENSE.QPL included in the 00014 // packaging of this file. 00015 00016 #ifndef ISUPPORT_H 00017 #define ISUPPORT_H 00018 00019 #ifndef USE_PCH 00020 #include <string> 00021 #endif 00022 00023 #include "IdentityReference.h" 00024 00025 //! Stores the ISUPPORT reply (005) key/value pairs of the network. 00026 class ISupport { 00027 public: 00028 //! The type of M_key_value_map. 00029 typedef std::map<std::string, std::string> key_value_map_type; 00030 00031 private: 00032 ServerConnection& M_server_connection; //!< Reference to the underlying server connection. 00033 key_value_map_type M_key_value_map; //!< The map storing all numeric 005 key/value pairs. 00034 00035 public: 00036 ISupport(ServerConnection& server_connection) : M_server_connection(server_connection) { } 00037 00038 //! This function is called when a new connection is initiated (when receiving numeric 004). 00039 void begin(void); 00040 //! This function is called as soon as possible after the last 005 message is received. 00041 void end(void); 00042 //! This function is called for every "key=value" pair in each 005 message. 00043 void add(std::string const& param); 00044 //! If \a key exists, returns true and writes the corresponding value to \a value, otherwise returns false. 00045 bool get(std::string const& key, std::string& value); 00046 }; 00047 00048 #endif // ISUPPORT_H
Copyright © 2005-2007 Carlo Wood. All rights reserved. |
---|