1 -- Created on: 2018-03-15
2 -- Created by: Stephan GARNAUD (ARM)
3 -- Copyright (c) 1998-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
6 -- This file is part of Open CASCADE Technology software library.
8 -- This library is free software; you can redistribute it and/or modify it under
9 -- the terms of the GNU Lesser General Public License version 2.1 as published
10 -- by the Free Software Foundation, with special exception defined in the file
11 -- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 -- distribution for complete text of the license and disclaimer of any warranty.
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
17 class Environment from OSD
19 ---Purpose: Management of system environment variables
20 -- An environment variable is composed of a variable name
23 -- To be portable among various systems, environment variables
24 -- are local to a process.
26 uses Protection, Error, AsciiString from TCollection
27 raises ConstructionError, NullObject, OSDError
30 Create returns Environment;
31 ---Purpose: Creates the object Environment.
34 Create (Name : AsciiString) returns Environment
35 ---Purpose: Creates an Environment variable initialized with value
36 -- set to an empty AsciiString.
38 raises ConstructionError;
40 Create (Name, Value : AsciiString) returns Environment
41 ---Purpose: Creates an Environment variable initialized with Value.
42 raises ConstructionError, NullObject;
43 -- ConstructionError is raised when invalid character is encountered.
46 SetValue (me : in out; Value : AsciiString)
47 ---Purpose: Changes environment variable value.
48 -- Raises ConstructionError either if the string contains
49 -- characters not in range of ' '...'~' or if the string
50 -- contains the character '$' which is forbiden.
52 raises ConstructionError is static;
54 Value (me : in out) returns AsciiString is static ;
55 ---Purpose: Gets the value of an environment variable
58 SetName (me : in out; name : AsciiString)
59 ---Purpose: Changes environment variable name.
60 -- Raises ConstructionError either if the string contains
61 -- characters not in range of ' '...'~' or if the string
62 -- contains the character '$' which is forbiden.
64 raises ConstructionError is static;
66 Name (me ) returns AsciiString is static;
67 ---Purpose: Gets the name of <me>.
70 Build (me : in out) is static ;
71 ---Purpose: Sets the value of an environment variable
72 -- into system (physically).
75 Remove(me : in out) is static ;
76 ---Purpose: Removes (physically) an environment variable
79 Failed (me) returns Boolean is static ;
80 ---Purpose: Returns TRUE if an error occurs
83 Reset (me : in out) is static ;
84 ---Purpose: Resets error counter to zero
88 ---Purpose: Raises OSD_Error
90 raises OSDError is static ;
92 Error (me) returns Integer is static ;
93 ---Purpose: Returns error number if 'Failed' is TRUE.
97 myName : AsciiString; --- Name of the variable
98 myValue : AsciiString;
100 end Environment from OSD;