indexing description: "[ This class is made, to create a more proper style. ]" date: "$Date$" revision: "$Revision$" class ROOT_CLASS inherit KL_SHARED_FILE_SYSTEM export {NONE} all end EM_SHARED_FILE_LOADER export {NONE} all end KL_SHARED_EXECUTION_ENVIRONMENT export {NONE} all end create make feature {NONE} -- Initialisation make is do create log_file_path.make_from_string (file_system.current_working_directory + "/line_count.log") create log_file.make_create_read_write (log_file_path) do_directory (execution_environment.interpreted_string ("$EM")) log_it (" TOTAL_LINES", total_lines.out) log_file.close end do_directory(a_directory_name: STRING) is -- do one directory local the_dir: KL_DIRECTORY i_file, i_directory: INTEGER do create the_dir.make (a_directory_name) from i_directory := 1 until i_directory >= the_dir.directory_names.count + 1 loop if not the_dir.directory_names.item (i_directory).is_equal ("EIFGEN") and not the_dir.directory_names.item (i_directory).is_equal ("CVS") and not the_dir.directory_names.item (i_directory).is_equal ("generated_wrapper") then log_it (the_dir.directory_names.item (i_directory), "activated") do_directory (a_directory_name + "/" + the_dir.directory_names.item (i_directory)) end i_directory := i_directory + 1 end io.put_string(" >> " + the_dir.name + "%N") from i_file := 1 until i_file >= the_dir.filenames.count + 1 loop checkfile(the_dir.name + "/" + the_dir.filenames.item (i_file)) i_file := i_file + 1 end end checkfile (a_file: STRING) is -- check one file local a_textfile: PLAIN_TEXT_FILE line_count: INTEGER do if file_system.has_extension (a_file, ".e") then file_loader.load_text_file_read (a_file) a_textfile := file_loader.last_text_file line_count := 0 from until a_textfile.count = 0 or else a_textfile.end_of_file loop a_textfile.read_line total_lines := total_lines + 1 line_count := line_count + 1 end log_it (" " + a_file, line_count.out) a_textfile.close end end log_it (a_filename, a_text: STRING) is -- write to log file do log_file.put_string (a_filename + ": " + a_text + "%N") io.put_string (a_filename + ": " + a_text + "%N") end total_lines: INTEGER log_file: PLAIN_TEXT_FILE working_path: KL_DIRECTORY log_file_path : STRING end