-
Notifications
You must be signed in to change notification settings - Fork 3
/
config_file_access_i.e
executable file
·70 lines (52 loc) · 1.46 KB
/
config_file_access_i.e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
note
component: "Eiffel Object Modelling Framework"
description: "Interface to config file reader/writer class"
keywords: "config, file"
author: "Thomas Beale <[email protected]>"
support: "http://www.openehr.org/issues/browse/AWB"
copyright: "Copyright (c) 2010- openEHR Foundation <http://www.openEHR.org>"
license: "Apache 2.0 License <http://www.apache.org/licenses/LICENSE-2.0.html>"
deferred class CONFIG_FILE_ACCESS_I
inherit
SHARED_APP_RESOURCES
export
{NONE} all
end
SHARED_MESSAGE_DB
export
{NONE} all;
{ANY} deep_twin, deep_copy, is_deep_equal, standard_is_equal
end
feature -- Definitions
file_header_text: STRING
deferred
end
feature -- Initialisation
make
do
create errors.make
create file_path.make_empty
end
feature -- Access
file_path: STRING
-- path to resource file
dt_tree: detachable DT_COMPLEX_OBJECT
-- result of parsing
errors: ERROR_ACCUMULATOR
feature -- Modification
set_file_path (a_file_path: STRING)
-- Make with `a_file_path', which doesn't necessarily exist as a file. If it does, it will be read;
-- if not, nothing will be read, and the first save request will create the file new.
do
file_path := a_file_path
end
feature -- Commands
load
-- read content from file and parse to Data Tree form.
-- if file not readable, or not there, or in wrong syntax, do nothing.
deferred
end
save (a_dt_tree: DT_COMPLEX_OBJECT)
deferred
end
end