| |
CBChatFilter::CBChatFilter() |
|
|
|
|
|
|
|
|
| |
|
| int |
CBChatFilter::ClearFilter() |
|
|
| Comments: |
| Removes all entries from the Chat Filter. |
|
|
|
|
|
|
| |
|
| int |
CBChatFilter::EnableFilter( |
int bEnableFlag = CB_TRUE) |
|
| Comments: |
| Enables or Disables the Chat Filter depending on if
TRUE or FALSE is passed in. |
| No Parameters means to Enable the filter. |
| When the Chat Filter is enabled, offensive text should
be replaced with @!#%$ type characters when
displayed. |
|
| Parameters: |
| bEnableFlag |
| TRUE or FALSE flag to
specify if the Filter should be Enabled or
Disabled. Defaults to CB_TRUE. |
|
|
|
|
|
|
|
| Returns: |
| CB_SUCCESS regardless of if the Filter is Enabled or
Disabled. |
|
| |
|
| int |
CBChatFilter::DisableFilter() |
|
|
| Comments: |
| Turns off the Chat Filter. |
| With the Chat Filter disabled, offensive text may be
shown. |
|
|
|
|
|
| |
|
| int |
CBChatFilter::AddString( |
CBSTRING sString) |
|
| Comments: |
| Adds a string to the Chat Filter. |
| Any strings contained in the Chat Filter that are
found in a chat message are replaced with #@%$! type
text if the Chat Filter is currently
enabled. |
| Only single words should be added. sString
should not contain a space. |
| Strings are converted to UPPERCASE before
storage. Filtering is not Case Sensitive so bad
words are filtered out regardless of Case. |
|
| Parameters: |
| sString |
| A String representing
a bad word to add to the Chat
Filter. |
|
|
|
| Returns: |
| CB_ERROR_EMPTY_STRING if sString is empty. |
| CB_SUCCESS if the word was added to the Chat Filter |
|
| |
|
| int |
CBChatFilter::RemoveString( |
CBSTRING sString) |
|
| Comments: |
| Removes a string from the Chat Filter. |
| All strings are stored in the Chat Filter in
UPPERCASE. sString is converted to UPPERCASE
before searching for it for removal. |
|
| Parameters: |
| sString |
| The String to remove
from the Chat Filter |
|
|
|
|
|
|
|
| Returns: |
| CB_SUCCESS regardless of if the string was already in
the Chat Filter or not. |
|
| |
|
| int |
CBChatFilter::FilterLine( |
CBSTRING & sString
/*IN OUT*/) |
|
| Comments: |
| Applies the Chat Filter to the incoming line of Text (sString).
If the Chat Filter is enabled, then any words found in
sString that have also been added as bad words to the
Chat Filter shall be replaced with non-offensive text
upon function return. |
| Does an in-place replacement of any offensive text in
sString and changes the bad words to #@%^! style
Text. |
| Any punctuation in the bad words is ignored and they
are still filtered out. Filtering is not Case
Sensitive. |
| An attempt is made to maintain the same length of the
string, but this is not guaranteed. |
| Only whole words are filtered, not portions of
words. |
| For Example: "Cockatrice"
typically would not have any filtering
applied. |
| sString typically represents an entire line of text
and does not need to be a single word. |
| Called by CBChatMessage::GetChatString() which formats
Chat messages and applies the Chat Filter to
them. |
|
|
| Parameters: |
| sString |
| A reference to a line of
text that should be potentially
filtered. |
| Upon entry this string
contains unfiltered text. |
| Upon exit this string
should be altered and any offensive words
replaced with #$@%! type text if the Chat Filter
is enabled. |
|
| |
|
| Returns: |
| sString is potentially altered if the Filter is on
and it contained bad words. |
| CB_SUCCESS regardless of if any words were replaced or
not. |
|
| |
|
| |