2 --Copyright: Matra Datavision 1992,1993
5 -- File: OSD_Environment.cdl
6 -- Created: Tue 18 1992
7 -- Author: Stephan GARNAUD (ARM)
13 class Environment from OSD
15 ---Purpose: Management of system environment variables
16 -- An environment variable is composed of a variable name
19 -- To be portable among various systems, environment variables
20 -- are local to a process.
22 uses Protection, Error, AsciiString from TCollection
23 raises ConstructionError, NullObject, OSDError
26 Create returns Environment;
27 ---Purpose: Creates the object Environment.
30 Create (Name : AsciiString) returns Environment
31 ---Purpose: Creates an Environment variable initialized with value
32 -- set to an empty AsciiString.
34 raises ConstructionError;
36 Create (Name, Value : AsciiString) returns Environment
37 ---Purpose: Creates an Environment variable initialized with Value.
38 raises ConstructionError, NullObject;
39 -- ConstructionError is raised when invalid character is encountered.
42 SetValue (me : in out; Value : AsciiString)
43 ---Purpose: Changes environment variable value.
44 -- Raises ConstructionError either if the string contains
45 -- characters not in range of ' '...'~' or if the string
46 -- contains the character '$' which is forbiden.
48 raises ConstructionError is static;
50 Value (me : in out) returns AsciiString is static ;
51 ---Purpose: Gets the value of an environment variable
54 SetName (me : in out; name : AsciiString)
55 ---Purpose: Changes environment variable name.
56 -- Raises ConstructionError either if the string contains
57 -- characters not in range of ' '...'~' or if the string
58 -- contains the character '$' which is forbiden.
60 raises ConstructionError is static;
62 Name (me ) returns AsciiString is static;
63 ---Purpose: Gets the name of <me>.
66 Build (me : in out) is static ;
67 ---Purpose: Sets the value of an environment variable
68 -- into system (physically).
71 Remove(me : in out) is static ;
72 ---Purpose: Removes (physically) an environment variable
75 Failed (me) returns Boolean is static ;
76 ---Purpose: Returns TRUE if an error occurs
79 Reset (me : in out) is static ;
80 ---Purpose: Resets error counter to zero
84 ---Purpose: Raises OSD_Error
86 raises OSDError is static ;
88 Error (me) returns Integer is static ;
89 ---Purpose: Returns error number if 'Failed' is TRUE.
93 myName : AsciiString; --- Name of the variable
94 myValue : AsciiString;
96 end Environment from OSD;