ircproxy  The Ultimate Cyborg

debug_ostream_operators.cc File Reference


Detailed Description

This file contains the implementation of ostream inserter operators used for debugging.

Definition in file debug_ostream_operators.cc.

#include "sys.h"
#include <iostream>
#include <libcw/support.h>
#include "debug.h"
#include <libcwd/buf2str.h>
#include <libcwd/cwprint.h>
#include "casereturnstr.h"
#include "PersistXML.h"
#include "Network.h"
#include "MessageIn.h"
#include "UserAnswer.h"
#include "Identity.h"
#include "IdentityReference.h"
#include "Authentication.h"
#include "Channel.h"
#include "Nick.h"
#include "ClientSession.h"
#include "QuestionTarget.h"
#include "NoticeTarget.h"
#include "ServerSession.h"
#include "DestructEvent.h"
#include "ServerConnection.h"
#include "Expression.h"
#include "keys.h"
#include "Matcher.h"
#include "Prefix.h"
#include "JustInTime.h"
#include "PseudoMessageEvent.h"
#include "Member.h"
#include "WhoRequest.h"

Go to the source code of this file.

Namespaces

namespace  debug

Functions

char const * debug::state_nt_name (state_nt state)
 Return a string literal representing the name of the state_nt state.
char const * debug::openmode_name (PersistXML::openmode_type openmode)
 Return a string literal representing the name of the PersistXML::openmode_type openmode.
char const * debug::match0_type_name (match0_type mt)
 Return a string literal representing the name of the match0_type mt.
char const * debug::match1_type_name (match1_type mt)
 Return a string literal representing the name of the match1_type mt.
char const * debug::command_name (int command)
 Return a string literal representing the name of the int command.
std::ostream & operator<< (std::ostream &os, state_nt state)
 For debugging purposes. Write a state_nt to os.
std::ostream & operator<< (std::ostream &os, PersistXML::openmode_type openmode)
 For debugging purposes. Write a PersistXML::openmode to os.
std::ostream & operator<< (std::ostream &os, match0_type mt)
 For debugging purposes. Write a match0_type to os.
std::ostream & operator<< (std::ostream &os, match1_type mt)
 For debugging purposes. Write a match1_type to os.
std::ostream & operator<< (std::ostream &os, Application const &)
 For debugging purposes. Write an Application to os.
std::ostream & operator<< (std::ostream &os, Network const &network)
 For debugging purposes. Write a Network to os.
std::ostream & operator<< (std::ostream &os, Server const &server)
 For debugging purposes. Write a Server to os.
std::ostream & operator<< (std::ostream &os, MessageIn const &msg)
 For debugging purposes. Write a MessageIn to os.
std::ostream & operator<< (std::ostream &os, ClientMessageIn const &msg)
 For debugging purposes. Write a ClientMessageIn to os.
std::ostream & operator<< (std::ostream &os, ServerMessageIn const &msg)
 For debugging purposes. Write a ServerMessageIn to os.
std::ostream & operator<< (std::ostream &os, UserAnswerRequestData const &request_data)
 For debugging purposes. Write a UserAnswerRequestData to os.
std::ostream & operator<< (std::ostream &os, UserAnswer const &answer)
 For debugging purposes. Write a UserAnswer to os.
std::ostream & operator<< (std::ostream &os, UserAnswerEventRequestBase const &request)
 For debugging purposes. Write a UserAnswerEventRequestBase to os.
std::ostream & operator<< (std::ostream &os, Identity const &identity)
 For debugging purposes. Write a Identity to os.
std::ostream & operator<< (std::ostream &os, ServerConnection const &server_connection)
 For debugging purposes. Write a ServerConnection to os.
std::ostream & operator<< (std::ostream &os, IdentityReference const &identity_reference)
 For debugging purposes. Write a IdentityReference to os.
std::ostream & operator<< (std::ostream &os, Authentication const &authentication)
 For debugging purposes. Write a Authentication to os.
std::ostream & operator<< (std::ostream &os, Channel const &channel)
 For debugging purposes. Write a Channel to os.
std::ostream & operator<< (std::ostream &os, Nick const &nick)
 For debugging purposes. Write a Nick to os.
std::ostream & operator<< (std::ostream &os, ClientSession const &client_session)
 For debugging purposes. Write a ClientSession to os.
std::ostream & operator<< (std::ostream &os, QuestionTarget const &question_target)
 For debugging purposes. Write a QuestionTarget to os.
std::ostream & operator<< (std::ostream &os, NoticeTarget const &notice_target)
 Print debug info for NoticeTarget instance notice_target.
std::ostream & operator<< (std::ostream &os, ServerSession const &server_session)
 For debugging purposes. Write a ServerSession to os.
std::ostream & operator<< (std::ostream &os, Target const &target)
 For debugging purposes. Write a Target to os.
std::ostream & operator<< (std::ostream &os, PseudoMessageEventRequestData const &request_data)
 For debugging purposes. Write a PseudoMessageEventRequestData to os.
std::ostream & operator<< (std::ostream &os, MessageOutData const &data)
 For debugging purposes. Write a MessageOutData to os.
std::ostream & operator<< (std::ostream &os, MessageOut const &message)
 For debugging purposes. Write a MessageOut to os.
std::ostream & operator<< (std::ostream &os, Priority const &priority)
 For debugging purposes. Write a Priority to os.
std::ostream & operator<< (std::ostream &os, timeval const &time)
 For debugging purposes. Write a timeval to os.
std::ostream & operator<< (std::ostream &os, regex_t const &)
 For debugging purposes. Write a regex_t to os.
std::ostream & operator<< (std::ostream &os, ExpressionEventType const &event_type)
 For debugging purposes. Write a ExpressionEventType to os.
std::ostream & operator<< (std::ostream &os, ExpressionEventServer const &expression_event_server)
 For debugging purposes. Write a ExpressionEventServer to os.
std::ostream & operator<< (std::ostream &os, Bool const &b)
 For debugging purposes. Write a Bool to os.
std::ostream & operator<< (std::ostream &os, Matcher const &matcher)
 For debugging purposes. Write a Matcher to os.
std::ostream & operator<< (std::ostream &os, MatchRequestList const &match_request_list)
 For debugging purposes. Write a MatchRequestList to os.
std::ostream & operator<< (std::ostream &os, MatchRequest const &match_request)
 For debugging purposes. Write a MatchRequest to os.
std::ostream & operator<< (std::ostream &os, MatcherEventType const &event_type)
 For debugging purposes. Write a MatcherEventType to os.
std::ostream & operator<< (std::ostream &os, MatcherEventRequestBase const &request)
 For debugging purposes. Write a MatcherEventRequestBase to os.
std::ostream & operator<< (std::ostream &os, Prefix const &prefix)
 For debugging purposes. Write a Prefix to os.
std::ostream & operator<< (std::ostream &os, Member const &member)
 Print debug info for Member instance member.
std::ostream & operator<< (std::ostream &os, WhoOptions const &options)
 Print debug info for WhoOptions instance who_options.
std::ostream & operator<< (std::ostream &os, WhoRequest const &who_request)
 Print debug info for WhoRequest instance who_request.
std::ostream & operator<< (std::ostream &os, SignalType const &signal)
 Print debug info for SignalType instance signal.
std::ostream & operator<< (std::ostream &os, ServerVersion const &server_version)
 Print debug info for ServerVersion instance server_version.
std::ostream & operator<< (std::ostream &os, AuthState const &auth_state)
 Print debug info for AuthState instance auth_state.


Function Documentation

std::ostream& operator<< ( std::ostream &  os,
state_nt  state 
)

For debugging purposes. Write a state_nt to os.

Definition at line 169 of file debug_ostream_operators.cc.

References debug::state_nt_name().

00170 {
00171   return os << debug::state_nt_name(state);
00172 }

std::ostream& operator<< ( std::ostream &  os,
PersistXML::openmode_type  openmode 
)

For debugging purposes. Write a PersistXML::openmode to os.

Definition at line 175 of file debug_ostream_operators.cc.

References debug::openmode_name().

00176 {
00177   return os << debug::openmode_name(openmode);
00178 }

std::ostream& operator<< ( std::ostream &  os,
match0_type  mt 
)

For debugging purposes. Write a match0_type to os.

Definition at line 181 of file debug_ostream_operators.cc.

References debug::match0_type_name().

00182 {
00183   return os << debug::match0_type_name(mt);
00184 }

std::ostream& operator<< ( std::ostream &  os,
match1_type  mt 
)

For debugging purposes. Write a match1_type to os.

Definition at line 187 of file debug_ostream_operators.cc.

References debug::match1_type_name().

00188 {
00189   return os << debug::match1_type_name(mt);
00190 }

std::ostream& operator<< ( std::ostream &  os,
Application const &   
)

For debugging purposes. Write an Application to os.

Print debug info for Application instance application.

Definition at line 193 of file debug_ostream_operators.cc.

00194 {
00195   return os << "(application)";
00196 }

std::ostream& operator<< ( std::ostream &  os,
Network const &  network 
)

For debugging purposes. Write a Network to os.

Print debug info for Network instance network.

Definition at line 199 of file debug_ostream_operators.cc.

References Network::domain(), Network::has_domain(), Network::name(), and Network::servers().

00200 {
00201   os << "{name:" << network.name();
00202   if (network.has_domain())
00203     os << ", domain:" << network.domain();
00204   os << ", servers:{";
00205   Network::servers_type::const_iterator iter = network.servers().begin();
00206   if (iter != network.servers().end())
00207   {
00208     os << *iter;
00209     while (++iter != network.servers().end())
00210       os << ", " << *iter;
00211   }
00212   return os << "}}";
00213 }

std::ostream& operator<< ( std::ostream &  os,
Server const &  server 
)

For debugging purposes. Write a Server to os.

Print debug info for Server instance server.

Definition at line 216 of file debug_ostream_operators.cc.

References Server::get_irc_name(), Server::hostname(), Server::last_connection_event(), and Server::ports().

00217 {
00218   os << "{hostname:" << server.hostname() <<
00219         ", irc_name:" << server.get_irc_name() <<
00220         ", ports:{";
00221   Server::ports_type::const_iterator iter = server.ports().begin();
00222   if (iter != server.ports().end())
00223   {
00224     os << *iter;
00225     while (++iter != server.ports().end())
00226       os << ", " << *iter;
00227   }
00228   os << "}, last_connection_event:" << server.last_connection_event();
00229   return os << '}';
00230 }

std::ostream& operator<< ( std::ostream &  os,
MessageIn const &  msg 
)

For debugging purposes. Write a MessageIn to os.

Print debug info for MessageIn instance msg.

Definition at line 233 of file debug_ostream_operators.cc.

References MessageIn::command_part(), MessageIn::has_prefix(), MessageIn::key(), MessageIn::params(), MessageIn::prefix_part(), and MessageIn::uninitialized().

00234 {
00235   os << '{';
00236   if (msg.uninitialized())
00237     return os << "<uninitialized>}";
00238   if (msg.has_prefix())
00239     os << "prefix:\"" << libcwd::buf2str(msg.prefix_part().start(), msg.prefix_part().len()) << "\", ";
00240   if (msg.command_part().start())
00241     os << "command:\"" <<
00242         libcwd::buf2str(msg.command_part().start(), msg.command_part().len()) << "\" [key:" << msg.key() << "]";
00243   os << ", params:{";
00244   MessageIn::params_type::const_iterator iter = msg.params().begin();
00245   if (iter != msg.params().end())
00246   {
00247     os << *iter;
00248     while(++iter != msg.params().end())
00249       os << ", " << *iter;
00250   }
00251   return os << "}}";
00252 }

std::ostream& operator<< ( std::ostream &  os,
ClientMessageIn const &  msg 
)

For debugging purposes. Write a ClientMessageIn to os.

Print debug info for ClientMessageIn instance msg.

Definition at line 255 of file debug_ostream_operators.cc.

References ClientMessageIn::client_session().

00256 {
00257   return os << "{client_session:" << msg.client_session() <<
00258      "; MessageIn:" << *static_cast<MessageIn const*>(&msg) << '}';
00259 }

std::ostream& operator<< ( std::ostream &  os,
ServerMessageIn const &  msg 
)

For debugging purposes. Write a ServerMessageIn to os.

Print debug info for ServerMessageIn instance msg.

Definition at line 262 of file debug_ostream_operators.cc.

References ServerMessageIn::server_session().

00263 {
00264   return os << "{server_session:" << msg.server_session() <<
00265      "; MessageIn:" << *static_cast<MessageIn const*>(&msg) << '}';
00266 }

std::ostream& operator<< ( std::ostream &  os,
UserAnswerRequestData const &  request_data 
)

For debugging purposes. Write a UserAnswerRequestData to os.

Print debug info for UserAnswerRequestData instance request_data.

Definition at line 269 of file debug_ostream_operators.cc.

References UserAnswerRequestData::client_session(), and UserAnswerRequestData::question().

00270 {
00271   return os << '{' << "question:\"" << request_data.question() << "\" [client_session:" << request_data.client_session() << "]}";
00272 }

std::ostream& operator<< ( std::ostream &  os,
UserAnswer const &  answer 
)

For debugging purposes. Write a UserAnswer to os.

Print debug info for UserAnswer instance answer.

Write UserAnswer answer to os.

Definition at line 275 of file debug_ostream_operators.cc.

References UserAnswer::M_answer, UserAnswer::M_client_session, and UserAnswer::M_target_name.

00276 {
00277   os << '{' << "answer:\"" << answer.M_answer;
00278   os << "\", client_session:" << answer.M_client_session;
00279   os << ", target:\"" << answer.M_target_name;
00280   os << "\"}";
00281   return os;
00282 }

std::ostream& operator<< ( std::ostream &  os,
UserAnswerEventRequestBase const &  request 
)

For debugging purposes. Write a UserAnswerEventRequestBase to os.

Print debug info for UserAnswerEventRequestBase instance request.

Write UserAnswerEventRequestBase request to os.

Definition at line 285 of file debug_ostream_operators.cc.

References UserAnswerEventRequestBase::M_request_data, and UserAnswerEventRequestBase::M_target.

00286 {
00287   os << "{request_data:" << request.M_request_data;
00288   if (request.M_target.get())
00289     os << ", target:" << *request.M_target.get();
00290   return os << '}';
00291 }

std::ostream& operator<< ( std::ostream &  os,
Identity const &  identity 
)

For debugging purposes. Write a Identity to os.

Print debug info for Identity instance identity.

Definition at line 294 of file debug_ostream_operators.cc.

References Identity::M_authentication, Identity::M_authpass, Identity::M_client_session, Identity::M_hostname, Identity::M_ident, Identity::M_key, Identity::M_network_name, Identity::M_private_network, and Identity::M_real_name.

00295 {
00296   os << "{key:" << identity.M_key;
00297 #ifdef VERBOSE_IDENTITY
00298 #ifdef PRINT_AUTHENTICATION
00299   if (identity.M_authentication.get())
00300     os << ", authentication:" << *identity.M_authentication.get();
00301   os << ", server_connection:" << identity.M_server_connection;
00302   if (!identity.M_authpass.empty())
00303     os << ", authpass:" << identity.M_authpass;
00304 #endif
00305   os << ", private_network:" << identity.M_private_network;
00306   if (identity.M_client_session)
00307     os << ", client_session:" << *identity.M_client_session;
00308   os << ", ident:\"" << identity.M_ident <<
00309         "\", hostname:\"" << identity.M_hostname <<
00310         "\", real_name:\"" << identity.M_real_name <<
00311         "\", network_name:\"" << identity.M_network_name << '"';
00312 #endif
00313   os << '}';
00314   return os;
00315 }

std::ostream& operator<< ( std::ostream &  os,
ServerConnection const &  server_connection 
)

For debugging purposes. Write a ServerConnection to os.

Print debug info for ServerConnection instance server_connection.

Definition at line 318 of file debug_ostream_operators.cc.

References ServerConnection::connect_delay(), ServerConnection::has_server_session(), ServerConnection::is_connected(), ServerConnection::M_server, ServerConnection::reconnect(), ServerConnection::secondary_connection(), ServerConnection::server_session(), ServerConnection::state(), ServerConnection::timed_out(), and ServerConnection::timed_out_count().

00319 {
00320   os << "{server:";
00321   if (server_connection.M_server.get())
00322     os << *server_connection.M_server.get();
00323   else
00324     os << "<none>";
00325   os << "; server_session:";
00326   if (server_connection.has_server_session())
00327     os << server_connection.server_session();
00328   else
00329     os << "<NULL>";
00330   os << "; reconnect:";
00331   if (server_connection.reconnect())
00332     os << "true";
00333   else
00334     os << "false";
00335   os << "; connected:";
00336   if (server_connection.is_connected())
00337     os << "true";
00338   else
00339     os << "false";
00340   os << "; state:" << server_connection.state();
00341   os << "; connect_delay:" << server_connection.connect_delay();
00342   os << "; timed_out:";
00343   if (server_connection.timed_out())
00344     os << "true";
00345   else
00346     os << "false";
00347   os << "; timed_out_count:" << server_connection.timed_out_count();
00348   os << "; secondary_connection:" << server_connection.secondary_connection();
00349   return os << '}';
00350 }

std::ostream& operator<< ( std::ostream &  os,
IdentityReference const &  identity_reference 
)

For debugging purposes. Write a IdentityReference to os.

Print debug info for IdentityReference instance identity_reference.

Definition at line 353 of file debug_ostream_operators.cc.

References IdentityReference::identity(), and Identity::key().

00354 {
00355   os << "[identity:" << identity_reference.identity().key() << ']';
00356   return os;
00357 }

std::ostream& operator<< ( std::ostream &  os,
Authentication const &  authentication 
)

For debugging purposes. Write a Authentication to os.

Print debug info for Authentication instance authentication.

Definition at line 360 of file debug_ostream_operators.cc.

References Authentication::M_ident, Authentication::M_realname, Authentication::M_received_nick, Authentication::M_received_user, Authentication::M_server_pass, and Authentication::M_service_pass.

00361 {
00362   os << "{server_pass:" <<
00363 #ifdef PRINT_AUTHENTICATION
00364       authentication.M_server_pass
00365 #else
00366       "***"
00367 #endif
00368       ;
00369   os << ", service_pass:" <<
00370 #ifdef PRINT_AUTHENTICATION
00371       authentication.M_service_pass
00372 #else
00373       "***"
00374 #endif
00375       ;
00376   os << ", ident:" << authentication.M_ident;
00377   os << ", realname:" << authentication.M_realname;
00378   os << ", received_nick:" << authentication.M_received_nick;
00379   os << ", received_user:" << authentication.M_received_user;
00380   return os << ' ' << static_cast<IdentityReference const&>(authentication) << '}';
00381 }

std::ostream& operator<< ( std::ostream &  os,
Channel const &  channel 
)

For debugging purposes. Write a Channel to os.

Print debug info for Channel instance channel.

Definition at line 384 of file debug_ostream_operators.cc.

00385 {
00386   os << "{Channel " << static_cast<Target const&>(channel);
00387   return os << '}';
00388 }

std::ostream& operator<< ( std::ostream &  os,
Nick const &  nick 
)

For debugging purposes. Write a Nick to os.

Print debug info for Nick instance nick.

Definition at line 391 of file debug_ostream_operators.cc.

00392 {
00393   os << "{Nick " << static_cast<Target const&>(nick);
00394   return os;
00395 }

std::ostream& operator<< ( std::ostream &  os,
ClientSession const &  client_session 
)

For debugging purposes. Write a ClientSession to os.

Print debug info for ClientSession instance client_session.

Definition at line 398 of file debug_ostream_operators.cc.

References IdentityReference::has_identity().

00399 {
00400   os << "{ClientSession ";
00401   if (client_session.has_identity())
00402     os << static_cast<IdentityReference const&>(client_session);
00403   else
00404     os << "with no Identity";
00405   return os << '}';
00406 }

std::ostream& operator<< ( std::ostream &  os,
QuestionTarget const &  question_target 
)

For debugging purposes. Write a QuestionTarget to os.

Print debug info for QuestionTarget instance question_target.

Definition at line 409 of file debug_ostream_operators.cc.

00410 {
00411   os << "{QuestionTarget " << static_cast<Target const&>(question_target) << '}'; 
00412   return os;
00413 }

std::ostream& operator<< ( std::ostream &  os,
NoticeTarget const &  notice_target 
)

Print debug info for NoticeTarget instance notice_target.

Definition at line 415 of file debug_ostream_operators.cc.

00416 {
00417   os << "{NoticeTarget " << static_cast<Target const&>(notice_target) << '}'; 
00418   return os;
00419 }

std::ostream& operator<< ( std::ostream &  os,
ServerSession const &  server_session 
)

For debugging purposes. Write a ServerSession to os.

Print debug info for ServerSession instance server_session.

Definition at line 422 of file debug_ostream_operators.cc.

00423 {
00424   os << "{ServerSession ";
00425   os << static_cast<IdentityReference const&>(server_session);
00426   return os << '}';
00427 }

std::ostream& operator<< ( std::ostream &  os,
Target const &  target 
)

For debugging purposes. Write a Target to os.

Print debug info for Target instance target.

Definition at line 430 of file debug_ostream_operators.cc.

00431 {
00432   //os << "{serverside_name:\"" << target.serverside_name() << "\", clientside_name:\"" << target.clientside_name() << "\", network:" << target.network().name();
00433   os << "{FIXME";
00434   return os << '}';
00435 }

std::ostream& operator<< ( std::ostream &  os,
PseudoMessageEventRequestData const &  request_data 
)

For debugging purposes. Write a PseudoMessageEventRequestData to os.

Print debug info for PseudoMessageEventRequestData instance request_data.

Definition at line 438 of file debug_ostream_operators.cc.

00439 {
00440   os << "{PseudoMessageEventRequestData FIXME";
00441   return os << '}';
00442 }

std::ostream& operator<< ( std::ostream &  os,
MessageOutData const &  data 
)

For debugging purposes. Write a MessageOutData to os.

Print debug info for MessageOutData instance data.

Definition at line 445 of file debug_ostream_operators.cc.

References MessageOutData::M_priority, and MessageOutData::M_tokens.

00446 {
00447   os << "{message:";
00448 #if 0
00449   for (std::vector<boost::shared_ptr<JustInTimeToken> >::const_iterator iter = data.M_tokens.begin(); iter != data.M_tokens.end(); ++iter)
00450   {
00451     std::string str1((*iter)->value(serverside));
00452     std::string str2((*iter)->value(clientside));
00453     if (str1 == str2)
00454       os << '{' << libcwd::buf2str(str1.data(), str1.length()) << '}';     
00455     else
00456       os << "{serverside:" << libcwd::buf2str(str1.data(), str1.length()) << ", clientside:" << libcwd::buf2str(str2.data(), str2.length()) << '}';
00457   }
00458 #else
00459   os << "FIXME";
00460 #endif
00461   os << "}, priority:" << data.M_priority;
00462   return os << '}';
00463 }

std::ostream& operator<< ( std::ostream &  os,
MessageOut const &  message 
)

For debugging purposes. Write a MessageOut to os.

Print debug info for MessageOut instance message.

Definition at line 466 of file debug_ostream_operators.cc.

References MessageOut::M_data.

00467 {
00468   os << "{data:" << *message.M_data;
00469   return os << '}';
00470 }

std::ostream& operator<< ( std::ostream &  os,
Priority const &  priority 
)

For debugging purposes. Write a Priority to os.

Print debug info for Priority instance priority.

Definition at line 473 of file debug_ostream_operators.cc.

00474 {
00475   // FIXME
00476   os << "{<priority>";
00477   return os << '}';
00478 }

std::ostream& operator<< ( std::ostream &  os,
timeval const &  time 
)

For debugging purposes. Write a timeval to os.

Print debug info for timeval instance time.

Definition at line 481 of file debug_ostream_operators.cc.

00482 {
00483   return os << "{tv_sec:" << time.tv_sec << ", tv_usec:" << time.tv_usec << '}';
00484 }

std::ostream& operator<< ( std::ostream &  os,
regex_t const &   
)

For debugging purposes. Write a regex_t to os.

Print debug info for regex_t instance regex.

Definition at line 487 of file debug_ostream_operators.cc.

00488 {
00489   os << "{<compiled>";
00490   return os << '}';
00491 }

std::ostream& operator<< ( std::ostream &  os,
ExpressionEventType const &  event_type 
)

For debugging purposes. Write a ExpressionEventType to os.

Definition at line 494 of file debug_ostream_operators.cc.

References ExpressionEventType::M_expression, and ExpressionEventType::M_expression_value.

00495 {
00496   os << "{expression_value:" << (event_type.M_expression_value ? "true" : "false");
00497   os << ", expression:\"";
00498   event_type.M_expression->print_on(os);
00499   return os << "\"}";
00500 }

std::ostream& operator<< ( std::ostream &  os,
ExpressionEventServer const &  expression_event_server 
)

For debugging purposes. Write a ExpressionEventServer to os.

Definition at line 503 of file debug_ostream_operators.cc.

References ExpressionEventServer::M_evaluation, ExpressionEventServer::M_expression, and ExpressionEventServer::M_ok.

00504 {
00505   os << "{expression:\"";
00506   expression_event_server.M_expression->print_on(os);
00507   os << "\", ok:" << (expression_event_server.M_ok ? "true" : "false");
00508   os << ", evaluation:" << (expression_event_server.M_evaluation ? "true" : "false");
00509   return os << '}';
00510 }

std::ostream& operator<< ( std::ostream &  os,
Bool const &  b 
)

For debugging purposes. Write a Bool to os.

Write Bool b to os.

Definition at line 513 of file debug_ostream_operators.cc.

References Bool::M_name, and Bool::M_value.

00514 {
00515   return os << "{value:" << b.M_value << "; name:\"" << b.M_name << "\"}";
00516 }

std::ostream& operator<< ( std::ostream &  os,
Matcher const &  matcher 
)

For debugging purposes. Write a Matcher to os.

Print debug info for Matcher instance matcher.

Definition at line 519 of file debug_ostream_operators.cc.

References Matcher::print_on(), and Matcher::print_type_on().

00520 {
00521   os << '{';
00522   matcher.print_type_on(os);
00523   os << ' ';
00524   matcher.Matcher::print_on(os);
00525   os << ", ";
00526   matcher.print_on(os);
00527   return os << '}';
00528 }

std::ostream& operator<< ( std::ostream &  os,
MatchRequestList const &  match_request_list 
)

For debugging purposes. Write a MatchRequestList to os.

Print debug info for MatchRequestList instance match_request_list.

Definition at line 531 of file debug_ostream_operators.cc.

References debug::command_name(), MatchRequestList::M_command, and MatchRequestList::M_conditions.

00532 {
00533   os << "{command: ";
00534   if (match_request_list.M_command < 0)
00535     os << debug::command_name(match_request_list.M_command);
00536   else
00537     os << match_request_list.M_command;
00538   os << ", conditions:{";
00539   std::multiset<boost::shared_ptr<Matcher> >::const_iterator iter = match_request_list.M_conditions.begin();
00540   if (iter != match_request_list.M_conditions.end())
00541   {
00542     os << **iter;
00543     while(++iter != match_request_list.M_conditions.end())
00544       os << ", " << **iter;
00545   }
00546   return os << "}}";
00547 }

std::ostream& operator<< ( std::ostream &  os,
MatchRequest const &  match_request 
)

For debugging purposes. Write a MatchRequest to os.

Print debug info for MatchRequest instance match_request.

Definition at line 550 of file debug_ostream_operators.cc.

References MatchRequest::match_request_list().

00551 {
00552   os << "{match_request_list:" << match_request.match_request_list();
00553   return os << '}';
00554 }

std::ostream& operator<< ( std::ostream &  os,
MatcherEventType const &  event_type 
)

For debugging purposes. Write a MatcherEventType to os.

Print debug info for MatcherEventType instance event_type.

Definition at line 557 of file debug_ostream_operators.cc.

References MatcherEventType::message().

00558 {
00559   os << "{message:" << event_type.message();
00560   return os << '}';
00561 }

std::ostream& operator<< ( std::ostream &  os,
MatcherEventRequestBase const &  request 
)

For debugging purposes. Write a MatcherEventRequestBase to os.

Write MatcherEventRequestBase request to os.

Definition at line 564 of file debug_ostream_operators.cc.

References MatcherEventRequestBase::M_request_data.

00565 {
00566   os << "{request_data:" << request.M_request_data;
00567   return os << '}';
00568 }

std::ostream& operator<< ( std::ostream &  os,
Prefix const &  prefix 
)

For debugging purposes. Write a Prefix to os.

Print debug info for Prefix instance prefix.

Definition at line 571 of file debug_ostream_operators.cc.

References Nick::data(), Prefix::empty(), NickData::hostname(), hostname_bit, NickData::initialized(), Prefix::nick(), Prefix::server_name(), NickData::username(), and username_bit.

00572 {
00573   os << '{';
00574   if (prefix.empty())
00575     os << "Empty Prefix";
00576   else if (!prefix.server_name().empty())
00577     os << prefix.server_name();
00578   else
00579   {
00580 #if 0
00581     if (prefix.nick()->serverside_name() == prefix.nick()->clientside_name())
00582       os << prefix.nick()->serverside_name();
00583     else
00584       os << "{serverside:" << prefix.nick()->serverside_name() << "; clientside:" << prefix.nick()->clientside_name() << '}';
00585 #else
00586     os << "FIXME";
00587 #endif
00588     os << '!';
00589     if ((prefix.nick()->data().initialized() & username_bit))
00590       os << prefix.nick()->data().username();
00591     else
00592       os << "<uninitialized>";
00593     os << '@';
00594     if ((prefix.nick()->data().initialized() & hostname_bit))
00595       os << prefix.nick()->data().hostname();
00596     else
00597       os << "<uninitialized>";
00598   }
00599   return os << '}';
00600 }

std::ostream& operator<< ( std::ostream &  os,
Member const &  member 
)

Print debug info for Member instance member.

Definition at line 602 of file debug_ostream_operators.cc.

References Member::get_nick().

00603 {
00604   os << '{';
00605   os << "nick:" << member.get_nick();
00606   return os << '}';
00607 }

std::ostream& operator<< ( std::ostream &  os,
WhoOptions const &  options 
)

Print debug info for WhoOptions instance who_options.

Definition at line 609 of file debug_ostream_operators.cc.

References WhoOptions::str().

00610 {
00611   return os << options.str();
00612 }

std::ostream& operator<< ( std::ostream &  os,
WhoRequest const &  who_request 
)

Print debug info for WhoRequest instance who_request.

Definition at line 614 of file debug_ostream_operators.cc.

References WhoRequest::mask(), and WhoRequest::options().

00615 {
00616   return os << "{mask:" << who_request.mask() << "; options:" << who_request.options() << '}';
00617 }

std::ostream& operator<< ( std::ostream &  os,
SignalType const &  signal 
)

Print debug info for SignalType instance signal.

Definition at line 619 of file debug_ostream_operators.cc.

00620 {
00621   return os << "{sig:" << signal.get_signal() << "; count:" << signal.get_count() << '}';
00622 }

std::ostream& operator<< ( std::ostream &  os,
ServerVersion const &  server_version 
)

Print debug info for ServerVersion instance server_version.

Definition at line 624 of file debug_ostream_operators.cc.

00625 {
00626   return os << libcwd::cwprint(server_version);
00627 }

std::ostream& operator<< ( std::ostream &  os,
AuthState const &  auth_state 
)

Print debug info for AuthState instance auth_state.

Definition at line 629 of file debug_ostream_operators.cc.

00630 {
00631   return os << libcwd::cwprint(auth_state);
00632 }


Copyright © 2005-2007 Carlo Wood.  All rights reserved.