ircproxy The Ultimate Cyborg |
00001 // ircproxy -- An IRC bouncer. 00002 // 00003 //! @file ISupport.cc 00004 //! @brief This file contains the implementation of the ISupport class. 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 USE_PCH 00017 #include "sys.h" 00018 #include "debug.h" 00019 #endif 00020 00021 #include "ISupport.h" 00022 #include "Identity.h" 00023 00024 void ISupport::begin(void) 00025 { 00026 M_key_value_map.clear(); 00027 } 00028 00029 void ISupport::end(void) 00030 { 00031 M_server_connection.server_session().found_network_name(); 00032 } 00033 00034 void ISupport::add(std::string const& param) 00035 { 00036 DoutEntering(dc::debug, "ISupport::add(" << param << ")"); 00037 std::string::size_type pos = param.find('='); 00038 if (pos == std::string::npos) 00039 M_key_value_map.insert(key_value_map_type::value_type(param, std::string())); 00040 else 00041 M_key_value_map.insert(key_value_map_type::value_type(param.substr(0, pos), param.substr(pos + 1))); 00042 } 00043 00044 bool ISupport::get(std::string const& key, std::string& value) 00045 { 00046 key_value_map_type::const_iterator iter = M_key_value_map.find(key); 00047 if (iter == M_key_value_map.end()) 00048 return false; 00049 value = iter->second; 00050 return true; 00051 } 00052
Copyright © 2005-2007 Carlo Wood. All rights reserved. |
---|