note description: "[ Objects that ... ]" author: "$Author$" date: "$Date$" revision: "$Revision$" class BUILD_HTML_INDEX inherit ARGUMENTS_32 create make feature {NONE} -- Initialization make -- Initialize `Current'. local ini_location: PATH icons_location: PATH output_location: PATH i,n: INTEGER s: READABLE_STRING_GENERAL do if argument_count >= 3 then create ini_location.make_from_string (argument (1)) ini_location := ini_location.absolute_path.canonical_path create icons_location.make_from_string (argument (2)) icons_location := icons_location.absolute_path.canonical_path create output_location.make_from_string (argument (3)) output_location := output_location.absolute_path.canonical_path is_png_mode := False is_svg_mode := False check is_svg_mode: is_svg_mode end if argument_count > 3 then from i := 4 n := argument_count until i > n loop s := argument (i) if s /= Void then if s.is_case_insensitive_equal ("--png") then is_png_mode := True end if s.is_case_insensitive_equal ("--svg") then is_svg_mode := True end end i := i + 1 end if not is_svg_mode and not is_png_mode then is_svg_mode := True -- Default end end process (ini_location, icons_location, output_location) else print ("Usage: prog path-to-ini-file icons-directory html-output%N") (create {EXCEPTIONS}).die (-1) end end feature -- Execution process (a_ini_location: PATH; a_icons_location: PATH; a_output_location: PATH) local ini, output: PLAIN_TEXT_FILE i: INTEGER rn: detachable IMMUTABLE_STRING_8 icon_name: IMMUTABLE_STRING_8 s: STRING_8 line, index: INTEGER fn1, fn2: STRING_32 l_icons_path: IMMUTABLE_STRING_8 l_width: INTEGER pw,ph: INTEGER fut: FILE_UTILITIES cl: detachable STRING_8 l_missing: BOOLEAN l_has_svg, l_has_png: BOOLEAN do create ini.make_with_path (a_ini_location) if ini.exists and then ini.is_access_readable then ini.open_read fn1 := a_output_location.parent.name fn2 := a_icons_location.name if fn2.starts_with (fn1) then fn2.remove_head (fn1.count + 1) end -- if not fn2.is_empty then l_icons_path := {UTF_CONVERTER}.utf_32_string_to_utf_8_string_8 (fn2) + "/" else l_icons_path := "" end create output.make_with_path (a_output_location) if not output.exists or else output.is_access_writable then output.create_read_write output.put_string ("[
]") if is_svg_mode then if is_png_mode then output.put_string ("