Difference between revisions of "ConfigurationParserLibrary"

(CONF_SYSTEM)
Line 2: Line 2:
 
The basic layout of a configuration system is a system that has multiple targets (which may inherit from each other), every target can have some libraries, assemblies override clusters and normal clusters. Clusters can have sub clusters.
 
The basic layout of a configuration system is a system that has multiple targets (which may inherit from each other), every target can have some libraries, assemblies override clusters and normal clusters. Clusters can have sub clusters.
 
[[Image:Config_basic_layout.png|||none]]
 
[[Image:Config_basic_layout.png|||none]]
== CONF_SYSTEM ==
+
=== CONF_SYSTEM ===
 
Every configuration file describes one CONF_SYSTEM and has one or more CONF_TARGET associated. Normally a CONF_SYSTEM object is generated by parsing a configuration file with CONF_LOAD.
 
Every configuration file describes one CONF_SYSTEM and has one or more CONF_TARGET associated. Normally a CONF_SYSTEM object is generated by parsing a configuration file with CONF_LOAD.
  
=== Implementation ===
+
==== Implementation ====
  
== CONF_TARGET ==
+
=== CONF_TARGET ===
  
== CONF_LIBRARY ==
+
=== CONF_LIBRARY ===
  
== CONF_ASSEMBLY ==
+
=== CONF_ASSEMBLY ===
  
== CONF_CLUSTER ==
+
=== CONF_CLUSTER ===
  
== CONF_OVERRIDE ==
+
=== CONF_OVERRIDE ===
 +
 
 +
== Retrieval and Storage ==
 +
Loading a configuration from a file.
 +
<code>[eiffel,n]
 +
load_configuration (a_file: STRING) is
 +
-- Load configuration file `a_file'.
 +
require
 +
a_file_ok: a_file /= Void and then not a_file.is_empty
 +
local
 +
l_loader: CONF_LOAD
 +
do
 +
create l_loader.make (create {CONF_PARSE_FACTORY})
 +
l_loader.retrieve_configuration (a_file)
 +
if l_loader.is_error then
 +
display_error (l_loader.last_error)
 +
else
 +
system := l_loader.last_system
 +
end
 +
end
 +
</code>

Revision as of 14:23, 30 October 2006

General

The basic layout of a configuration system is a system that has multiple targets (which may inherit from each other), every target can have some libraries, assemblies override clusters and normal clusters. Clusters can have sub clusters.

Config basic layout.png

CONF_SYSTEM

Every configuration file describes one CONF_SYSTEM and has one or more CONF_TARGET associated. Normally a CONF_SYSTEM object is generated by parsing a configuration file with CONF_LOAD.

Implementation

CONF_TARGET

CONF_LIBRARY

CONF_ASSEMBLY

CONF_CLUSTER

CONF_OVERRIDE

Retrieval and Storage

Loading a configuration from a file.

load_configuration (a_file: STRING) is
			-- Load configuration file `a_file'.
		require
			a_file_ok: a_file /= Void and then not a_file.is_empty
		local
			l_loader: CONF_LOAD
		do
			create l_loader.make (create {CONF_PARSE_FACTORY})
			l_loader.retrieve_configuration (a_file)
			if l_loader.is_error then
				display_error (l_loader.last_error)
			else
				system := l_loader.last_system
			end
		end