com.leafdigital.irc.api
Interface IRCEncoding

All Superinterfaces:
Singleton

public interface IRCEncoding
extends Singleton

Provides character encoding information. Character encoding settings come from the user's preferences; this class can obtain those settings for any given context.

Also contains a method for processing colour codes.


Nested Class Summary
static interface IRCEncoding.EncodingInfo
          Information about encoding in a different context
 
Method Summary
 IRCEncoding.EncodingInfo getEncoding(Server s, java.lang.String chan, IRCUserAddress user)
          Obtains the character encoding for a given situation.
 java.lang.String processEscapes(java.lang.String input, boolean allowStyles, boolean allowColours)
          Processes a string for IRC style escapes.
 

Method Detail

getEncoding

IRCEncoding.EncodingInfo getEncoding(Server s,
                                     java.lang.String chan,
                                     IRCUserAddress user)
Obtains the character encoding for a given situation.

Parameters:
s - Server (may be null)
chan - Channel (may be null)
user - User (may be null)
Returns:
Encoding information

processEscapes

java.lang.String processEscapes(java.lang.String input,
                                boolean allowStyles,
                                boolean allowColours)
Processes a string for IRC style escapes. If you allow styles or colours, then XML tags will be added to the string to indicate where colours start and end. In this case the string must have been preprocessed to escape XML characters. If you don't allow colours then they are simply removed (and the string need not be escaped).

Parameters:
input - Input text
allowStyles - True to allow styles (bold etc)
allowColours - True to allow colours
Returns:
Processed string


Copyright © 2011 Samuel Marshall. All rights reserved.