note description: "Convertor to do string to integer/natural conversion" library: "Free implementation of ELKS library" status: "See notice at end of class." legal: "See notice at end of class." date: "$Date: 2017-03-28 12:36:24 +0000 (Tue, 28 Mar 2017) $" revision: "$Revision: 100064 $" frozen class interface STRING_TO_INTEGER_CONVERTOR create make feature -- State machine setting reset (type: INTEGER_32) -- Reset current convertor to parse integer of type type. ensure then internal_overflowed_set: not internal_overflowed part1_set: part1 = 0 part2_set: part2 = 0 feature -- Status report separators_valid (separators: STRING_8): BOOLEAN -- Are separators contained in separators valid? overflowed: BOOLEAN -- Is integer parsed so far overflowed? underflowed: BOOLEAN -- Is integer parsed so fa underflowed? parse_successful: BOOLEAN -- This only means we didn't enter an invalid state when parsing, -- it doesn't mean that we have got an valid integer. -- You need to check is_integral_integer or is_part_of_integer. conversion_type_valid (type: INTEGER_32): BOOLEAN -- If conversion type valid? is_part_of_integer: BOOLEAN -- Is character sequence that has been parsed so far a valid start part of an integer? is_integral_integer: BOOLEAN -- Is character sequence that has been parsed so far a valid integral integer? feature -- String parsing parse_string_with_type (s: READABLE_STRING_GENERAL; type: INTEGER_32) -- Parse string s as integer of type type. parse_character (c: CHARACTER_8) -- Parse next character c. feature -- Access parsed_integer_8: INTEGER_8 -- INTEGER_8 representation of parsed string parsed_integer_16: INTEGER_16 -- INTEGER_16 representation of parsed string parsed_integer_32: INTEGER_32 -- INTEGER representation of parsed string -- Was declared in STRING_TO_INTEGER_CONVERTOR as synonym of parsed_integer. parsed_integer: INTEGER_32 -- INTEGER representation of parsed string -- Was declared in STRING_TO_INTEGER_CONVERTOR as synonym of parsed_integer_32. parsed_integer_64: INTEGER_64 -- INTEGER_64 representation of parsed string parsed_natural_8: NATURAL_8 -- NATURAL_8 representation of parsed string parsed_natural_16: NATURAL_16 -- NATURAL_16 representation of parsed string parsed_natural_32: NATURAL_32 -- NATURAL_32 representation of parsed string -- Was declared in STRING_TO_INTEGER_CONVERTOR as synonym of parsed_natural. parsed_natural: NATURAL_32 -- NATURAL_32 representation of parsed string -- Was declared in STRING_TO_INTEGER_CONVERTOR as synonym of parsed_natural_32. parsed_natural_64: NATURAL_64 -- NATURAL_64 representation of parsed string note copyright: "Copyright (c) 1984-2017, Eiffel Software and others" license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)" source: "[ Eiffel Software 5949 Hollister Ave., Goleta, CA 93117 USA Telephone 805-685-1006, Fax 805-685-6869 Website http://www.eiffel.com Customer support http://support.eiffel.com ]" end -- class STRING_TO_INTEGER_CONVERTOR
Generated by ISE EiffelStudio