note description: "[ Terminal text style flags to use with {TERMINAL}. ]" legal: "See notice at end of class." status: "See notice at end of class." date: "$Date$" revision: "$Revision$" class TERMINAL_TEXT_STYLE inherit ENUMERATED_TYPE [NATURAL_8] redefine is_valid_value end create default_create, make convert make ({NATURAL_8}), item: {NATURAL_8} feature -- Access none: NATURAL_8 = 0x0 -- No special style. bold: NATURAL_8 = 0x1 -- Bold text style. italic: NATURAL_8 = 0x2 -- Italic text style. underlined: NATURAL_8 = 0x4 -- Underlined text style. reversed: NATURAL_8 = 0x8 -- Reversed foreground and background color style. hidden: NATURAL_8 = 0x10 -- Hidden text style (background matches foreground). feature -- Status report is_valid_value (n: NATURAL_8): BOOLEAN -- local l_default: NATURAL_8 l_mask: NATURAL_8 l_members: like members i, nb: INTEGER l_assert: BOOLEAN do Result := Precursor (n) or else (0x1F & internal_value) = internal_value end feature -- Bit operations bit_and alias "&" (a_other: like Current): TERMINAL_TEXT_STYLE -- Bitwise AND. require a_other_attached: attached a_other do Result := item & a_other.item ensure result_attached: attached Result end bit_or alias "|" (a_other: like Current): TERMINAL_TEXT_STYLE -- Bitwise OR. require a_other_attached: attached a_other do Result := item | a_other.item ensure result_attached: attached Result end feature {NONE} -- Factory members: ARRAY [NATURAL_8] -- once Result := <