note description: "String to real/double convertor" library: "Free implementation of ELKS library" status: "See notice at end of class." legal: "See notice at end of class." date: "$Date: 2017-03-23 19:18:26 +0000 (Thu, 23 Mar 2017) $" revision: "$Revision: 100033 $" frozen class interface STRING_TO_REAL_CONVERTOR create make feature -- Status reporting conversion_type_valid (type: INTEGER_32): BOOLEAN -- Is conversion type type valid? overflowed: BOOLEAN -- Is real number parsed so far overflowed? underflowed: BOOLEAN -- Is real number parsed so far 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 double/real number. -- You need to check is_double or is_real. separators_valid (separators: STRING_8): BOOLEAN -- Are separators contained in separators valid? is_integral_double: BOOLEAN -- Is character sequence that has been parsed represents a valid double? is_integral_real: BOOLEAN -- Is character sequence that has been parsed represents a valid real? is_part_of_double: BOOLEAN -- Is character sequence that has been parsed so far a valid start part of double? is_part_of_real: BOOLEAN -- Is character sequence that has been parsed so far a valid start part of real? parsed_double: REAL_64 -- Parsed double value parsed_real: REAL_32 -- Parsed real value feature -- Status setting reset (type: INTEGER_32) -- Reset current convertor to parse real number string of type type. ensure then natural_part_set: natural_part = 0.to_double fractional_part_set: fractional_part = 0.to_double fractional_divider_set: fractional_divider = 0.to_double exponent_set: exponent = 0 is_negative_set: not is_negative has_negative_exponent_set: not has_negative_exponent has_fractional_part_set: not has_fractional_part needs_digit_set: not needs_digit feature -- Parse parse_string_with_type (s: READABLE_STRING_GENERAL; type: INTEGER_32) -- Parse string s as real number of type type. parse_character (c: CHARACTER_8) -- Parse character c. 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_REAL_CONVERTOR
Generated by ISE EiffelStudio