struct FastIRC::Prefix
- FastIRC::Prefix
- Struct
- Value
- Object
Included Modules
- FastIRC::ParserMacros
Defined in:
fast_irc/message.crfast_irc/parser.cr
Constructors
-
.new(str : Slice(UInt8), target_start : Int32 | Nil, target_length : Int32 | Nil, user_start : Int32 | Nil, user_length : Int32 | Nil, host_start : Int32 | Nil, host_length : Int32 | Nil)
Initialises the Prefix with a backing Slice(UInt8) of bytes, and the locations of strings inside the slice.
-
.new(target : Nil | String, user : Nil | String = nil, host : Nil | String = nil)
Initialises the Prefix with the given target, user and host strings.
Class Method Summary
-
.parse(str : Slice(UInt8))
Parses an IRC Prefix from a Slice(UInt8).
-
.parse(str)
Parses an IRC Prefix from a String.
Instance Method Summary
- #==(other : self)
- #host
- #host?
- #inspect(io)
- #target
- #target?
-
#to_s(io)
Converts the prefix back into an IRC format string.
- #user
- #user?
Constructor Detail
def self.new(str : Slice(UInt8), target_start : Int32 | Nil, target_length : Int32 | Nil, user_start : Int32 | Nil, user_length : Int32 | Nil, host_start : Int32 | Nil, host_length : Int32 | Nil)
#
Initialises the Prefix with a backing Slice(UInt8) of bytes, and the locations of strings inside the slice. Use this method only if you know what you are doing.
Initialises the Prefix with the given target, user and host strings.
Class Method Detail
def self.parse(str : Slice(UInt8))
#
Parses an IRC Prefix from a Slice(UInt8). The slice should not have trailing \r\n characters and should be null terminated.
def self.parse(str)
#
Parses an IRC Prefix from a String. The String should not have the trailing "\r\n" characters.