|
Erebot
latest
A modular IRC bot for PHP 5.3+
|
Interface for a class handling an IRC collation. More...
Inheritance diagram for Erebot\Interfaces\IrcCollator:Public Member Functions | |
| compare ($a, $b) | |
| limitedCompare ($a, $b, $len) | |
| normalizeNick ($nick) | |
Interface for a class handling an IRC collation.
An IRC collation is used to compare different IRC objets, eg. two IRC nicknames, in order to find out whether they refer to the same thing or not.
Definition at line 32 of file IrcCollator.php.
| Erebot\Interfaces\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. |
Implemented in Erebot\IrcCollator.
| Erebot\Interfaces\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. |
Implemented in Erebot\IrcCollator.
| Erebot\Interfaces\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. |
Implemented in Erebot\IrcCollator.