dialect.common

Helper functions needed to parse raw IRC event strings into dialect.defs.IRCEvents.

Also things that don't belong anywhere else.

Public Imports

lu.string
public import lu.string : contains, nom;

Members

Classes

IRCParseException
class IRCParseException

IRC Parsing Exception, thrown when there were errors parsing.

Enums

IRCControlCharacter
enum IRCControlCharacter

Certain characters that signal specific meaning in an IRC context.

Functions

decodeIRCv3String
string decodeIRCv3String(string line)

Decodes an IRCv3 tag string, replacing some characters.

isAuthService
bool isAuthService(IRCUser sender, IRCParser parser)

Inspects an dialect.defs.IRCUser and judges whether or not it is authentication services.

isUpper
char isUpper(char c, IRCServer.CaseMapping caseMapping)

Checks whether the passed char is in uppercase as per the supplied case mappings.

isValidChannel
bool isValidChannel(string channel, IRCServer server)

Examines a string and judges whether or not it *looks* like a channel.

isValidHostmask
bool isValidHostmask(string hostmask, IRCServer server)

Makes a cursory verification of a hostmask, ensuring that it doesn't contain invalid characters. May very well have false positives.

isValidNickname
bool isValidNickname(string nickname, IRCServer server)

Examines a string and judges whether or not it *looks* like a nickname.

isValidNicknameCharacter
bool isValidNicknameCharacter(ubyte c)

Returns whether or not a passed char can be part of a nickname.

matchesByMask
auto matchesByMask(IRCUser this_, IRCUser that, IRCServer.CaseMapping caseMapping)

Compares this dialect.defs.IRCUser with a second one, treating fields with asterisks as glob wildcards, mimicking *!*@* mask matching.

opEqualsCaseInsensitive
bool opEqualsCaseInsensitive(string lhs, string rhs, IRCServer.CaseMapping mapping)

Compares two strings to see if they match if case is ignored.

setMode
void setMode(IRCChannel channel, string signedModestring, string data, IRCServer server)

Sets a new or removes a dialect.defs.IRCChannel.Mode.

stripModesign
string stripModesign(string nickname, IRCServer server, string modesigns)

Takes a nickname and strips it of any prepended mode signs, like the @ in @nickname. Saves the stripped signs in the ref string modesigns.

stripModesign
string stripModesign(string nickname, IRCServer server)

Convenience function to stripModesign that doesn't take an out string parameter to store the stripped modesign characters in.

toLower
char toLower(char c, IRCServer.CaseMapping caseMapping)

Produces the passed char in lowercase as per the supplied case mappings.

toLowerCase
string toLowerCase(string name, IRCServer.CaseMapping caseMapping)

Produces the passed string in lowercase as per the supplied case mappings.

typenumsOf
auto typenumsOf(IRCServer.Daemon daemon)

Returns the typenums mapping for a given dialect.defs.IRCServer.Daemon.

Interfaces

Postprocessor
interface Postprocessor

Postprocessor interface for concrete postprocessors to inherit from.