indexing description: "Microsoft Help 2.0 Project (VSIP)." date: "$Date$" revision: "$Revision$" class MSHELP_PROJECT inherit HELP_PROJECT UTILITY_FUNCTIONS TABLE_OF_CONTENTS_CONSTANTS create make feature -- File generate_files is -- Generate necessary files do create_project_file create_files_file create_collection_file create_stylesheet_file end feature {NONE} -- File create_toc_file is -- Create table of contents file local template: PLAIN_TEXT_TEMPLATE_FILE template_file: FILE_NAME do create template_file.make_from_string (Shared_constants.Application_constants.Templates_path) template_file.extend ("HelpTOCTemplate.HxT") create template.make (template_file) template.add_symbol ("toc", full_toc_text) template.save_file (toc_file_name) end create_project_file is -- Create the actual project file for Visual Studio local template: PLAIN_TEXT_TEMPLATE_FILE template_file: FILE_NAME do create template_file.make_from_string (Shared_constants.Application_constants.Templates_path) template_file.extend ("HelpProjectTemplate.hwproj") create template.make (template_file) template.add_symbol ("project_name", name) template.add_symbol ("files", retrieve_files (Help_directory, False, True)) template.add_symbol ("directories", retrieve_files (Help_directory, True, True)) template.save_file (project_file_name) create project_file.make (template.template_filename) end create_files_file is -- Create the project include files file local template: PLAIN_TEXT_TEMPLATE_FILE template_file: FILE_NAME do create template_file.make_from_string (Shared_constants.Application_constants.templates_path) template_file.extend ("HelpFilesTemplate.HxF") create template.make (template_file) template.add_symbol ("files", retrieve_files (help_directory, False, False)) template.save_file (Help_directory.name + "\" + name + ".HxF") create files_file.make (template.template_filename) end create_collection_file is -- Create the projects collection file local template: PLAIN_TEXT_TEMPLATE_FILE template_file: FILE_NAME do create template_file.make_from_string (Shared_constants.Application_constants.templates_path) template_file.extend ("HelpCollectionTemplate.HxC") create template.make (template_file) template.add_symbol ("project_name", name) template.save_file (Help_directory.name + "\" + name + ".HxC") create collection_file.make (template.template_filename) end create_stylesheet_file is -- Create the stylesheet do copy_stylesheet (temporary_help_location (Shared_project.root_directory, False)) end project_file: PLAIN_TEXT_FILE -- Project File files_file: PLAIN_TEXT_FILE -- Project File collection_file: PLAIN_TEXT_FILE -- Table of Contents File feature -- Commands build_table_of_contents is -- Build table of contents do create_toc_file end generate is -- Generate help project do generate_files end feature {NONE} -- Project retrieve_files (a_dir: DIRECTORY; get_dirs, tags: BOOLEAN): STRING is -- Retrieve the project files string or directories string if `get_dirs' local l_cnt, l_upper_count: INTEGER l_folder: DIRECTORY l_name: DIRECTORY_NAME l_url: STRING l_util: UTILITY_FUNCTIONS do create l_util from l_cnt := 0 l_upper_count := a_dir.count a_dir.open_read a_dir.start create Result.make_empty until l_cnt = l_upper_count loop a_dir.readentry if not (a_dir.lastentry.is_equal (".") or a_dir.lastentry.is_equal (".."))then create l_name.make_from_string (a_dir.name) l_name.extend (a_dir.lastentry) l_folder ?= create {DIRECTORY}.make (l_name) if l_folder.exists and then not l_folder.is_empty then if get_dirs then l_url := l_util.toc_friendly_url (clone (a_dir.name)) Result.append ("