X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=docs%2Fmodule-doc%2Fclasschanrec.html;h=00d40233e776bac5a39e2a1c807016e4c2d69c5c;hb=654ff4ae2f06704de2beb1050021c8196f693cb5;hp=a3e7664aaf7fffb9295302ac961259cc15f26867;hpb=7455e1c881f12eaf3ec9658ac84add6b61b131a3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/docs/module-doc/classchanrec.html b/docs/module-doc/classchanrec.html index a3e7664aa..00d40233e 100644 --- a/docs/module-doc/classchanrec.html +++ b/docs/module-doc/classchanrec.html @@ -1,81 +1,103 @@ -chanrec class Reference - +InspIRCd: chanrec class Reference + - -
-Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  
-

chanrec Class Reference

Holds all relevent information for a channel. + +
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members
+

chanrec Class Reference

Holds all relevent information for a channel. More...

#include <channels.h>

-Inheritance diagram for chanrec:

Inheritance graph
- - - -
[legend]
Collaboration diagram for chanrec:

Collaboration graph
- - - -
[legend]
List of all members. +Inherits Extensible. +

+List of all members.

- - - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 chanrec ()
 Creates a channel record and initialises it with default values.

virtual ~chanrec ()
void SetCustomMode (char mode, bool mode_on)
 Sets or unsets a custom mode in the channels info.

void SetCustomModeParam (char mode, char *parameter, bool mode_on)
 Sets or unsets the parameters for a custom mode in a channels info.

bool IsCustomModeSet (char mode)
 Returns true if a custom mode is set on a channel.

std::string GetModeParameter (char mode)
 Returns the parameter for a custom mode on a channel.

 chanrec ()
 Creates a channel record and initialises it with default values.

virtual ~chanrec ()

Public Attributes

char name [CHANMAX]
 The channels name.

char custom_modes [MAXMODES]
 Custom modes for the channel.

char topic [MAXBUF]
 Channel topic.

time_t created
 Creation time.

time_t topicset
 Time topic was set.

char setby [NICKMAX]
 The last user to set the topic.

long limit
 Contains the channel user limit.

char key [32]
 Contains the channel key.

short int topiclock
 Nonzero if the mode +t is set.

short int noexternal
 Nonzero if the mode +n is set.

short int inviteonly
 Nonzero if the mode +i is set.

short int moderated
 Nonzero if the mode +m is set.

short int secret
 Nonzero if the mode +s is set.

short int c_private
 Nonzero if the mode +p is set.

BanList bans
 The list of all bans set on the channel.

char name [CHANMAX]
 The channels name.

char custom_modes [MAXMODES]
 Custom modes for the channel.

char topic [MAXBUF]
 Channel topic.

time_t created
 Creation time.

time_t topicset
 Time topic was set.

char setby [NICKMAX]
 The last user to set the topic.

long limit
 Contains the channel user limit.

char key [32]
 Contains the channel key.

short int topiclock
 Nonzero if the mode +t is set.

short int noexternal
 Nonzero if the mode +n is set.

short int inviteonly
 Nonzero if the mode +i is set.

short int moderated
 Nonzero if the mode +m is set.

short int secret
 Nonzero if the mode +s is set.

short int c_private
 Nonzero if the mode +p is set.

BanList bans
 The list of all bans set on the channel.


Detailed Description

-Holds all relevent information for a channel. +Holds all relevent information for a channel.

This class represents a channel, and contains its name, modes, time created, topic, topic set time, etc, and an instance of the BanList type.

-Definition at line 70 of file channels.h.


Constructor & Destructor Documentation

-

- +Definition at line 94 of file channels.h.

Constructor & Destructor Documentation

+

+

-
+ - - - + + +
chanrec::chanrec   [inline]  ) 
@@ -90,34 +112,36 @@ Definition at line 70 of

-Creates a channel record and initialises it with default values. +Creates a channel record and initialises it with default values.

-Definition at line 138 of file channels.h. +Definition at line 113 of file channels.cpp.

-

00139         {
-00140                 strcpy(name,"");
-00141                 strcpy(custom_modes,"");
-00142                 strcpy(topic,"");
-00143                 strcpy(setby,"");
-00144                 strcpy(key,"");
-00145                 created = topicset = limit = 0;
-00146                 topiclock = noexternal = inviteonly = moderated = secret = c_private = false;
-00147         }
+References c_private, created, custom_modes, inviteonly, key, limit, moderated, name, noexternal, secret, setby, topic, topiclock, and topicset.
+

+

00114 {
+00115         strcpy(name,"");
+00116         strcpy(custom_modes,"");
+00117         strcpy(topic,"");
+00118         strcpy(setby,"");
+00119         strcpy(key,"");
+00120         created = topicset = limit = 0;
+00121         topiclock = noexternal = inviteonly = moderated = secret = c_private = false;
+00122 }
 
-

- +

+

-
+ - + - - + + @@ -135,20 +159,263 @@ Definition at line 138 o

-Definition at line 149 of file channels.h. +Definition at line 185 of file channels.h. +

+

00185 { /* stub */ }
+
+ +
virtual chanrec::~chanrec virtual chanrec::~chanrec    )  [inline, virtual]
+

Member Function Documentation

+

+ + + + +
+ + + + + + + + + + +
std::string chanrec::GetModeParameter char  mode  ) 
+
+ + + + + +
+   + + +

+Returns the parameter for a custom mode on a channel. +

+For example if "+L #foo" is set, and you pass this method 'L', it will return '#foo'. If the mode is not set on the channel, or the mode has no parameters associated with it, it will return an empty string. +

+Definition at line 186 of file channels.cpp. +

+References custom_mode_params. +

+

00187 {
+00188         if (custom_mode_params.size())
+00189         {
+00190                 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
+00191                 {
+00192                         if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
+00193                         {
+00194                                 return std::string(i->parameter);
+00195                         }
+00196                 }
+00197         }
+00198         return std::string("");
+00199 }
+
+

+ + + + +
+ + + + + + + + + + +
bool chanrec::IsCustomModeSet char  mode  ) 
+
+ + + + + +
+   + + +

+Returns true if a custom mode is set on a channel. +

+ +

+Definition at line 180 of file channels.cpp. +

+References DEBUG. +

+

00181 {
+00182         log(DEBUG,"Checking ISCustomModeSet: %c %s",mode,this->custom_modes);
+00183         return (strchr(this->custom_modes,mode) != 0);
+00184 }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void chanrec::SetCustomMode char  mode,
bool  mode_on
+
+ + + + + +
+   + + +

+Sets or unsets a custom mode in the channels info. +

+ +

+Definition at line 124 of file channels.cpp. +

+References custom_modes, DEBUG, and SetCustomModeParam(). +

+

00125 {
+00126         if (mode_on) {
+00127                 char m[3];
+00128                 m[0] = mode;
+00129                 m[1] = '\0';
+00130                 if (!strchr(this->custom_modes,mode))
+00131                 {
+00132                         strlcat(custom_modes,m,MAXMODES);
+00133                 }
+00134                 log(DEBUG,"Custom mode %c set",mode);
+00135         }
+00136         else {
+00137 
+00138                 std::string a = this->custom_modes;
+00139                 int pos = a.find(mode);
+00140                 a.erase(pos,1);
+00141                 strncpy(this->custom_modes,a.c_str(),MAXMODES);
+00142 
+00143                 log(DEBUG,"Custom mode %c removed: modelist='%s'",mode,this->custom_modes);
+00144                 this->SetCustomModeParam(mode,"",false);
+00145         }
+00146 }
+
+

+ + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
void chanrec::SetCustomModeParam char  mode,
char *  parameter,
bool  mode_on
+
+ + + +
+   + + +

+Sets or unsets the parameters for a custom mode in a channels info.

-

00149 { /* stub */ }
+
+

+Definition at line 149 of file channels.cpp. +

+References ModeParameter::channel, custom_mode_params, DEBUG, ModeParameter::mode, and ModeParameter::parameter. +

+Referenced by SetCustomMode(). +

+

00150 {
+00151 
+00152         log(DEBUG,"SetCustomModeParam called");
+00153         ModeParameter M;
+00154         M.mode = mode;
+00155         strlcpy(M.channel,this->name,CHANMAX);
+00156         strlcpy(M.parameter,parameter,MAXBUF);
+00157         if (mode_on)
+00158         {
+00159                 log(DEBUG,"Custom mode parameter %c %s added",mode,parameter);
+00160                 custom_mode_params.push_back(M);
+00161         }
+00162         else
+00163         {
+00164                 if (custom_mode_params.size())
+00165                 {
+00166                         for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
+00167                         {
+00168                                 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
+00169                                 {
+00170                                         log(DEBUG,"Custom mode parameter %c %s removed",mode,parameter);
+00171                                         custom_mode_params.erase(i);
+00172                                         return;
+00173                                 }
+00174                         }
+00175                 }
+00176                 log(DEBUG,"*** BUG *** Attempt to remove non-existent mode parameter!");
+00177         }
+00178 }
 


Member Data Documentation

-

- +

+

- @@ -161,20 +428,20 @@ Definition at line 149 o +Definition at line 159 of file channels.h.
+ -
BanList chanrec::bans + BanList chanrec::bans

-The list of all bans set on the channel. +The list of all bans set on the channel.

-Definition at line 134 of file channels.h.

-

- +

+

- @@ -187,20 +454,22 @@ Definition at line 134 o +Referenced by chanrec().
+ -
short int chanrec::c_private + short int chanrec::c_private

-Nonzero if the mode +p is set. +Nonzero if the mode +p is set. +

+This value cannot be set at the same time as chanrec::secret

-This value cannot be set at the same time as chanrec::secret +Definition at line 155 of file channels.h.

-Definition at line 130 of file channels.h.

-

- +

+

- @@ -213,20 +482,22 @@ Definition at line 130 o +Definition at line 111 of file channels.h. +

+Referenced by chanrec(), and Server::PseudoToUser().

+ -
time_t chanrec::created + time_t chanrec::created

-Creation time. +Creation time.

-Definition at line 86 of file channels.h.

-

- +

+

- @@ -239,20 +510,22 @@ Definition at line 86 of +Definition at line 103 of file channels.h. +

+Referenced by chanrec(), and SetCustomMode().

+ -
char chanrec::custom_modes[MAXMODES] + char chanrec::custom_modes[MAXMODES]

-Custom modes for the channel. +Custom modes for the channel.

Plugins may use this field in any way they see fit.

-Definition at line 79 of file channels.h.

-

- +

+

- @@ -265,20 +538,22 @@ Definition at line 79 of +Definition at line 141 of file channels.h. +

+Referenced by chanrec().

+ -
short int chanrec::inviteonly + short int chanrec::inviteonly

-Nonzero if the mode +i is set. +Nonzero if the mode +i is set.

-Definition at line 116 of file channels.h.

-

- +

+

- @@ -291,20 +566,22 @@ Definition at line 116 o +Definition at line 129 of file channels.h. +

+Referenced by chanrec().

+ -
char chanrec::key[32] + char chanrec::key[32]

-Contains the channel key. +Contains the channel key.

If this value is an empty string, there is no channel key in place.

-Definition at line 104 of file channels.h.

-

- +

+

- @@ -317,20 +594,22 @@ Definition at line 104 o +Definition at line 124 of file channels.h. +

+Referenced by chanrec().

+ -
long chanrec::limit + long chanrec::limit

-Contains the channel user limit. +Contains the channel user limit.

If this value is zero, there is no limit in place.

-Definition at line 99 of file channels.h.

-

- +

+

- @@ -343,20 +622,22 @@ Definition at line 99 of +Definition at line 145 of file channels.h. +

+Referenced by chanrec().

+ -
short int chanrec::moderated + short int chanrec::moderated

-Nonzero if the mode +m is set. +Nonzero if the mode +m is set.

-Definition at line 120 of file channels.h.

-

- +

+

- @@ -369,20 +650,22 @@ Definition at line 120 o +Definition at line 99 of file channels.h. +

+Referenced by chanrec(), and Server::PseudoToUser().

+ -
char chanrec::name[CHANMAX] + char chanrec::name[CHANMAX]

-The channels name. +The channels name.

-Definition at line 75 of file channels.h.

-

- +

+

- @@ -395,20 +678,22 @@ Definition at line 75 of +Definition at line 137 of file channels.h. +

+Referenced by chanrec().

+ -
short int chanrec::noexternal + short int chanrec::noexternal

-Nonzero if the mode +n is set. +Nonzero if the mode +n is set.

-Definition at line 112 of file channels.h.

-

- +

+

- @@ -421,20 +706,22 @@ Definition at line 112 o +Referenced by chanrec().
+ -
short int chanrec::secret + short int chanrec::secret

-Nonzero if the mode +s is set. +Nonzero if the mode +s is set. +

+This value cannot be set at the same time as chanrec::c_private

-This value cannot be set at the same time as chanrec::c_private +Definition at line 150 of file channels.h.

-Definition at line 125 of file channels.h.

-

- +

+

- @@ -447,20 +734,22 @@ Definition at line 125 o +Definition at line 119 of file channels.h. +

+Referenced by chanrec(), and Server::PseudoToUser().

+ -
char chanrec::setby[NICKMAX] + char chanrec::setby[NICKMAX]

-The last user to set the topic. +The last user to set the topic.

If this member is an empty string, no topic was ever set.

-Definition at line 94 of file channels.h.

-

- +

+

- @@ -473,20 +762,22 @@ Definition at line 94 of +Definition at line 108 of file channels.h. +

+Referenced by chanrec(), and Server::PseudoToUser().

+ -
char chanrec::topic[MAXBUF] + char chanrec::topic[MAXBUF]

-Channel topic. +Channel topic.

If this is an empty string, no channel topic is set.

-Definition at line 83 of file channels.h.

-

- +

+

- @@ -499,20 +790,22 @@ Definition at line 83 of +Definition at line 133 of file channels.h. +

+Referenced by chanrec().

+ -
short int chanrec::topiclock + short int chanrec::topiclock

-Nonzero if the mode +t is set. +Nonzero if the mode +t is set.

-Definition at line 108 of file channels.h.

-

- +

+

- @@ -525,18 +818,20 @@ Definition at line 108 o +Referenced by chanrec(), and Server::PseudoToUser().
+ -
time_t chanrec::topicset + time_t chanrec::topicset

-Time topic was set. +Time topic was set. +

+If no topic was ever set, this will be equal to chanrec::created

-If no topic was ever set, this will be equal to chanrec::created +Definition at line 115 of file channels.h.

-Definition at line 90 of file channels.h.

-


The documentation for this class was generated from the following file: -
Generated on Sun Mar 30 19:35:36 2003 for InspIRCd by +
The documentation for this class was generated from the following files: +
Generated on Wed Apr 13 13:07:01 2005 for InspIRCd by -doxygen1.3-rc3
+doxygen +1.3.3