From 78a96055c428d1970ece93dfb01902ac0d1699bd Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 4 Apr 2004 22:03:32 +0000 Subject: New documentation to document user/channel mode handling git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@380 e03df62e-2008-0410-955e-edbf42e46eb7 --- docs/module-doc/classchanrec.html | 281 +++++++++++++++++++++++++++----------- 1 file changed, 203 insertions(+), 78 deletions(-) (limited to 'docs/module-doc/classchanrec.html') diff --git a/docs/module-doc/classchanrec.html b/docs/module-doc/classchanrec.html index 7d4a1a061..cb8ca4706 100644 --- a/docs/module-doc/classchanrec.html +++ b/docs/module-doc/classchanrec.html @@ -5,7 +5,7 @@
-Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  
+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...

@@ -26,9 +26,13 @@ Inheritance diagram for chanrec:



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

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

-virtual ~chanrec () +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.

@@ -68,8 +72,8 @@ This class represents a channel, and contains its name, modes, time created, top

-Definition at line 70 of file channels.h.


Constructor & Destructor Documentation

-

+Definition at line 83 of file channels.h.


Constructor & Destructor Documentation

+

@@ -98,23 +102,23 @@ Creates a channel record and initialises it with default values.

-Definition at line 6 of file channels.cpp. +Definition at line 12 of file channels.cpp.

-References c_private, created, inviteonly, limit, moderated, noexternal, secret, topiclock, and topicset. +References c_private, created, inviteonly, limit, moderated, noexternal, secret, topiclock, and topicset.

-

00007 {
-00008         strcpy(name,"");
-00009         strcpy(custom_modes,"");
-00010         strcpy(topic,"");
-00011         strcpy(setby,"");
-00012         strcpy(key,"");
-00013         created = topicset = limit = 0;
-00014         topiclock = noexternal = inviteonly = moderated = secret = c_private = false;
-00015 }
+
00013 {
+00014         strcpy(name,"");
+00015         strcpy(custom_modes,"");
+00016         strcpy(topic,"");
+00017         strcpy(setby,"");
+00018         strcpy(key,"");
+00019         created = topicset = limit = 0;
+00020         topiclock = noexternal = inviteonly = moderated = secret = c_private = false;
+00021 }
 
-

+

@@ -141,13 +145,102 @@ References c_private,

-Definition at line 148 of file channels.h. +Definition at line 174 of file channels.h.

-

00148 { /* stub */ }
+
00174 { /* stub */ }
 


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 87 of file channels.cpp. +

+References custom_mode_params. +

+

00088 {
+00089         if (custom_mode_params.size())
+00090         {
+00091                 for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
+00092                 {
+00093                         if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
+00094                         {
+00095                                 return std::string(i->parameter);
+00096                         }
+00097                 }
+00098         }
+00099         return std::string("");
+00100 }
+
+

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

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

+ +

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

+

00082 {
+00083         log(DEBUG,"Checking ISCustomModeSet: %c %s",mode,this->custom_modes);
+00084         return (strchr(this->custom_modes,mode) != 0);
+00085 }
+

@@ -187,34 +280,35 @@ Sets or unsets a custom mode in the channels info.

-Definition at line 17 of file channels.cpp. -

-References custom_modes. -

-

00018 {
-00019         if (mode_on) {
-00020                 char m[3];
-00021                 m[0] = mode;
-00022                 m[1] = '\0';
-00023                 if (!strchr(this->custom_modes,mode))
-00024                 {
-00025                         strncat(custom_modes,m,MAXMODES);
-00026                 }
-00027                 log(DEBUG,"Custom mode %c set",mode);
-00028         }
-00029         else {
-00030                 char temp[MAXMODES];
-00031                 int count = 0;
-00032                 for (int q = 0; q < strlen(custom_modes); q++) {
-00033                         if (custom_modes[q] != mode) {
-00034                                 temp[count++] = mode;
-00035                         }
-00036                 }
-00037                 temp[count] = '\0';
-00038                 strncpy(custom_modes,temp,MAXMODES);
-00039                 log(DEBUG,"Custom mode %c removed",mode);
-00040         }
-00041 }
+Definition at line 23 of file channels.cpp.
+

+References custom_modes, and SetCustomModeParam(). +

+

00024 {
+00025         if (mode_on) {
+00026                 char m[3];
+00027                 m[0] = mode;
+00028                 m[1] = '\0';
+00029                 if (!strchr(this->custom_modes,mode))
+00030                 {
+00031                         strncat(custom_modes,m,MAXMODES);
+00032                 }
+00033                 log(DEBUG,"Custom mode %c set",mode);
+00034         }
+00035         else {
+00036                 char temp[MAXBUF];
+00037                 int count = 0;
+00038                 for (int q = 0; q < strlen(custom_modes); q++) {
+00039                         if (custom_modes[q] != mode) {
+00040                                 temp[count++] = mode;
+00041                         }
+00042                 }
+00043                 temp[count] = '\0';
+00044                 strncpy(custom_modes,temp,MAXMODES);
+00045                 log(DEBUG,"Custom mode %c removed",mode);
+00046                 this->SetCustomModeParam(mode,"",false);
+00047         }
+00048 }
 
@@ -263,10 +357,41 @@ Sets or unsets the parameters for a custom mode in a channels info.

-Definition at line 43 of file channels.cpp. -

-

00044 {
-00045 }
+Definition at line 50 of file channels.cpp.
+

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

+Referenced by SetCustomMode(). +

+

00051 {
+00052 
+00053         log(DEBUG,"SetCustomModeParam called");
+00054         ModeParameter M;
+00055         M.mode = mode;
+00056         strcpy(M.channel,this->name);
+00057         strcpy(M.parameter,parameter);
+00058         if (mode_on)
+00059         {
+00060                 log(DEBUG,"Custom mode parameter %c %s added",mode,parameter);
+00061                 custom_mode_params.push_back(M);
+00062         }
+00063         else
+00064         {
+00065                 if (custom_mode_params.size())
+00066                 {
+00067                         for (vector<ModeParameter>::iterator i = custom_mode_params.begin(); i < custom_mode_params.end(); i++)
+00068                         {
+00069                                 if ((i->mode == mode) && (!strcasecmp(this->name,i->channel)))
+00070                                 {
+00071                                         log(DEBUG,"Custom mode parameter %c %s removed",mode,parameter);
+00072                                         custom_mode_params.erase(i);
+00073                                         return;
+00074                                 }
+00075                         }
+00076                 }
+00077                 log(DEBUG,"*** BUG *** Attempt to remove non-existent mode parameter!");
+00078         }
+00079 }
 
@@ -294,7 +419,7 @@ The list of all bans set on the channel.

-Definition at line 134 of file channels.h. +Definition at line 148 of file channels.h.

@@ -320,9 +445,9 @@ Nonzero if the mode +p is set.

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

-Definition at line 130 of file channels.h. +Definition at line 144 of file channels.h.

-Referenced by chanrec(). +Referenced by chanrec().

@@ -348,9 +473,9 @@ Creation time.

-Definition at line 86 of file channels.h. +Definition at line 100 of file channels.h.

-Referenced by chanrec(). +Referenced by chanrec().

@@ -376,9 +501,9 @@ Custom modes for the channel.

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

-Definition at line 79 of file channels.h. +Definition at line 92 of file channels.h.

-Referenced by SetCustomMode(). +Referenced by SetCustomMode().

@@ -404,9 +529,9 @@ Nonzero if the mode +i is set.

-Definition at line 116 of file channels.h. +Definition at line 130 of file channels.h.

-Referenced by chanrec(). +Referenced by chanrec().

@@ -432,7 +557,7 @@ 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. +Definition at line 118 of file channels.h.

@@ -458,9 +583,9 @@ Contains the channel user limit.

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

-Definition at line 99 of file channels.h. +Definition at line 113 of file channels.h.

-Referenced by chanrec(). +Referenced by chanrec().

@@ -486,9 +611,9 @@ Nonzero if the mode +m is set.

-Definition at line 120 of file channels.h. +Definition at line 134 of file channels.h.

-Referenced by chanrec(). +Referenced by chanrec().

@@ -514,7 +639,7 @@ The channels name.

-Definition at line 75 of file channels.h. +Definition at line 88 of file channels.h.

@@ -540,9 +665,9 @@ Nonzero if the mode +n is set.

-Definition at line 112 of file channels.h. +Definition at line 126 of file channels.h.

-Referenced by chanrec(). +Referenced by chanrec().

@@ -568,9 +693,9 @@ Nonzero if the mode +s is set.

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

-Definition at line 125 of file channels.h. +Definition at line 139 of file channels.h.

-Referenced by chanrec(). +Referenced by chanrec().

@@ -596,7 +721,7 @@ 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. +Definition at line 108 of file channels.h.

@@ -622,7 +747,7 @@ Channel topic.

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

-Definition at line 83 of file channels.h. +Definition at line 97 of file channels.h.

@@ -648,9 +773,9 @@ Nonzero if the mode +t is set.

-Definition at line 108 of file channels.h. +Definition at line 122 of file channels.h.

-Referenced by chanrec(). +Referenced by chanrec().

@@ -676,14 +801,14 @@ Time topic was set.

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

-Definition at line 90 of file channels.h. +Definition at line 104 of file channels.h.

-Referenced by chanrec(). +Referenced by chanrec().


The documentation for this class was generated from the following files: -
Generated on Sat Apr 3 16:36:10 2004 for InspIRCd by +
Generated on Sun Apr 4 23:02:23 2004 for InspIRCd by doxygen1.3-rc3
-- cgit v1.2.3