Eiffel Media API
Overview Cluster Class Classes Index      Previous Next      Top Features

em.goof.loader

Class EM_GOOF_LOADER_XML_INPUT_FILE_PARSER


Direct ancestors

EM_GOOF_LOADER_PARSE_ERROR_CONSTANTS, KL_SHARED_FILE_SYSTEM

Known direct descendants

EM_GOOF_LOADER_LEVEL_PARSER

Features

Invariants

indexing

description

Parser for XML input files.

date

$Date: 2005/10/23 15:36:59 $

revision

$Revision: 1.4 $

deferred class

EM_GOOF_LOADER_XML_INPUT_FILE_PARSER

inherit

EM_GOOF_LOADER_PARSE_ERROR_CONSTANTS
KL_SHARED_FILE_SYSTEM

feature -- Access

error_code: INTEGER

-- Code of error.

-- (From EM_GOOF_LOADER_ERROR_CONSTANTS)

error_description: STRING

-- Description of last parser error

-- (From EM_GOOF_LOADER_ERROR_CONSTANTS)

require
has_error: has_error
ensure
Result_exists: Result /= Void
Result_not_empty: not Result.is_empty
ensure then
Result_exists: Result /= Void
Result_not_empty: not Result.is_empty
file_name: STRING

-- Name of file where error occurred.

-- (From EM_GOOF_LOADER_ERROR_CONSTANTS)

root_element: XM_ELEMENT

-- Root element of document

require
parsed: is_parsed
ensure
Result_exists: Result /= Void
xml_document: XM_DOCUMENT

-- Parsed XML document

require
parsed: is_parsed
ensure
Result_exists: Result /= Void

feature -- Status report

can_process: BOOLEAN

-- Can document tree be processed?

has_error: BOOLEAN

-- Did a parser error occur?

-- (From EM_GOOF_LOADER_ERROR_CONSTANTS)

has_file_name: BOOLEAN

-- Has a file name been set?

is_parsed: BOOLEAN

-- Has a level been parsed?

feature -- Status setting

set_file_name (a_name: STRING)

-- Set file name to a_name.

require
file_name_valid: File_system.is_file_readable (a_name)
file_exists: File_system.file_exists (a_name)
ensure
file_name_set: has_file_name
not_parsed: not is_parsed
set_working_directory

-- Set the current working directory to the place where the filename
-- comes from (needs to be done if dtd-files with relative paths should be accepted).

require
file_name_set: has_file_name

feature -- Basic operations

parse

-- Parse level.

require
file_name_set: has_file_name
ensure
parsed_if_no_error: not has_error implies is_parsed
process

-- Process document tree.

require
processing_ready: can_process

feature -- File systems

file_system: KL_FILE_SYSTEM

-- Underlying file system

-- (From KL_SHARED_FILE_SYSTEM)

ensure
file_system_not_void: Result /= Void
current_file_system: Result.is_current_file_system
unix_file_system: KL_UNIX_FILE_SYSTEM

-- Unix-like file system

-- (From KL_SHARED_FILE_SYSTEM)

ensure
file_system_not_void: Result /= Void
windows_backslash_only_file_system: KL_WINDOWS_FILE_SYSTEM

-- Windows-like file system which accepts only \ as
-- directory separator

-- (From KL_SHARED_FILE_SYSTEM)

ensure
file_system_not_void: Result /= Void
windows_file_system: KL_WINDOWS_FILE_SYSTEM

-- Windows-like file system which accepts both
-- \ and / as directory separator

-- (From KL_SHARED_FILE_SYSTEM)

ensure
file_system_not_void: Result /= Void

feature {EM_GOOF_LOADER_ERROR_CONSTANTS} -- Implementation

slots: ARRAY [STRING]

-- Slots for additional information.

-- (From EM_GOOF_LOADER_ERROR_CONSTANTS)

invariant

xml_parser_exists: xml_parser /= Void
tree_pipe_exists: tree_pipe /= Void
has_error_definition: has_error = ((error_code > 0) ornot xml_parser.is_correct)
has_file_name_definition: has_file_name = (file_name /= Void and thennot file_name.is_empty)
parsed_constraint: is_parsed implies has_file_name

error_constraint: error_code > 0 implies has_error
slot_constraint: error_code > 0 implies(slots /= Void and then is_complete (error_code, slots))
error_code_positive: error_code >= 0
non_empty_description: has_error implies (error_description /= Void andnot error_description.is_empty)

-- From ANY
reflexive_equality: standard_is_equal (Current)
reflexive_conformance: conforms_to (Current)

end