|
Erebot
latest
A modular IRC bot for PHP 5.3+
|
An abstract class that provides an IRC collation. More...
Inheritance diagram for Erebot\IrcCollator:Public Member Functions | |
| compare ($a, $b) | |
| limitedCompare ($a, $b, $len) | |
| normalizeNick ($nick) | |
Protected Member Functions | |
| realNormalizeNick ($nick) | |
An abstract class that provides an IRC collation.
Using subclasses of this class, you can compare two IRC nicknames.
Definition at line 30 of file IrcCollator.php.
| Erebot\IrcCollator::compare | ( | $a, | |
| $b | |||
| ) |
Compares two string in a case-insensitive fashion (like strcasecmp).
| $a | First string to compare. |
| $b | Second string to compare. |
| int | An integer less than, equal to or greater than zero if $a is found, respectively, to be less than, to match, or be greater than $b. |
Implements Erebot\Interfaces\IrcCollator.
Definition at line 32 of file IrcCollator.php.
| Erebot\IrcCollator::limitedCompare | ( | $a, | |
| $b, | |||
| $len | |||
| ) |
Compares two string in a case-insensitive fashion up to a given length (like strncasecmp).
| $a | First string to compare. |
| $b | Second string to compare. |
| $len | Limit the comparison to only the first $len bytes of each string. |
| int | An integer less than, equal to or greater than zero if the first $len bytes of $a are found, respectively, to be less than, to match, or be greater than the first $len bytes of $b. |
Implements Erebot\Interfaces\IrcCollator.
Definition at line 40 of file IrcCollator.php.
| Erebot\IrcCollator::normalizeNick | ( | $nick | ) |
Normalize (canonicalize) some IRC nickname.
This method can be used to compare two IRC nicknames like this:
| string | $nick | The nickname to canonicalize. |
| string | A canonical representation of the nickname. |
Implements Erebot\Interfaces\IrcCollator.
Definition at line 49 of file IrcCollator.php.
|
protected |
Normalize (canonicalize) some IRC nickname.
This method can be used to compare two IRC nicknames like this:
| string | $nick | The nickname to canonicalize. |
| string | A canonical representation of the nickname. |
Definition at line 71 of file IrcCollator.php.