0022484: UNICODE characters support
[occt.git] / src / OSD / OSD_Error.cdl
1 -- Created on: 1992-05-18
2 -- Created by: Stephan GARNAUD (ARM)
3 -- Copyright (c) 1992-1999 Matra Datavision
4 -- Copyright (c) 1999-2014 OPEN CASCADE SAS
5 --
6 -- This file is part of Open CASCADE Technology software library.
7 --
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.
13 --
14 -- Alternatively, this file may be used under the terms of Open CASCADE
15 -- commercial license or contractual agreement.
16
17 class Error from OSD
18
19    ---Purpose: Accurate management of OSD specific errors.
20
21 --  Each method can be error tested with object.Failed().
22 --  To manage an occuring error, just use object.Perror(); 
23 --
24 --  It is possible to reset the error counter to zero.
25 --  To do this use the 'Reset' method .
26
27
28 --  Only 4 methods are usable for programmer :
29 --      Failed   to see whether an error occured or not.
30 --      Value    to get system independent error code.
31 --               (See annexe for a complete list of error code).
32 --      Reset    to reset error code to zero (no error).
33 --      Perror   to raise OSDError and print a self explanatory error
34 --               message. This message says why an error occurs and
35 --               explains what to do to correct it.
36
37 uses
38   WhoAmI, AsciiString from TCollection
39
40 raises
41   OSDError 
42
43 is
44  Create returns Error;
45    ---Purpose: Initializes Error to be without any Error.
46    --          This is only used by OSD, not by programmer.
47    ---Level: Public
48
49  Perror (me : in out)
50    ---Purpose: Raises OSD_Error with accurate error message.
51    raises OSDError is static;
52    ---Level: Public
53
54  SetValue (me : in out; Errcode : Integer; From : Integer; Message : AsciiString) is static;
55    ---Purpose: Instantiates error
56    --          This is only used by OSD methods to instantiates an error code.
57    --          No description is done for the programmer.
58    ---Level: Public
59
60  Error (me) returns Integer is static;
61    ---Purpose: Returns an accurate error code.
62    --          To test these values, you must include "OSD_ErrorList.hxx"
63    ---Level: Public
64
65
66  Failed (me) returns Boolean is static;
67    ---Purpose: Returns TRUE if an error occurs
68    --          This is a way to test if a system call succeeded or not.
69    ---Level: Public
70
71  Reset (me : in out) is static;
72    ---Purpose: Resets error counter to zero
73    --          This allows the user to ignore an error (WARNING).
74    ---Level: Public
75
76 fields
77    myMessage : AsciiString;   -- Internal error message
78    myErrno   : Integer;  -- UNIX/VMS error used by OSD only
79    myCode    : WhoAmI;   -- Accuracy code in error for OSD only
80    extCode   : Integer;  -- Error type decoded for user
81 end Error from OSD;
82
83
84
85