summaryrefslogtreecommitdiff
path: root/inc/Interface_Check.hxx
blob: 9494ff2cc875e2e1b772a1cf991d03026847228b (plain)
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
// This file is generated by WOK (CPPExt).
// Please do not edit this file; modify original file instead.
// The copyright and license terms as defined for the original file apply to 
// this header file considered to be the "object code" form of the original source.

#ifndef _Interface_Check_HeaderFile
#define _Interface_Check_HeaderFile

#ifndef _Standard_HeaderFile
#include <Standard.hxx>
#endif
#ifndef _Standard_DefineHandle_HeaderFile
#include <Standard_DefineHandle.hxx>
#endif
#ifndef _Handle_Interface_Check_HeaderFile
#include <Handle_Interface_Check.hxx>
#endif

#ifndef _Handle_TColStd_HSequenceOfHAsciiString_HeaderFile
#include <Handle_TColStd_HSequenceOfHAsciiString.hxx>
#endif
#ifndef _Handle_Standard_Transient_HeaderFile
#include <Handle_Standard_Transient.hxx>
#endif
#ifndef _MMgt_TShared_HeaderFile
#include <MMgt_TShared.hxx>
#endif
#ifndef _Handle_TCollection_HAsciiString_HeaderFile
#include <Handle_TCollection_HAsciiString.hxx>
#endif
#ifndef _Standard_CString_HeaderFile
#include <Standard_CString.hxx>
#endif
#ifndef _Standard_Boolean_HeaderFile
#include <Standard_Boolean.hxx>
#endif
#ifndef _Standard_Integer_HeaderFile
#include <Standard_Integer.hxx>
#endif
#ifndef _Interface_CheckStatus_HeaderFile
#include <Interface_CheckStatus.hxx>
#endif
#ifndef _Handle_Message_Messenger_HeaderFile
#include <Handle_Message_Messenger.hxx>
#endif
class TColStd_HSequenceOfHAsciiString;
class Standard_Transient;
class Standard_OutOfRange;
class Message_Msg;
class TCollection_HAsciiString;
class Message_Messenger;


//! Defines a Check, as a list of Fail or Warning Messages under <br>
//!           a literal form, which can be empty. A Check can also bring an <br>
//!           Entity, which is the Entity to which the messages apply <br>
//!           (this Entity may be any Transient Object). <br>
//! <br>
//!           Messages can be stored in two forms : the definitive form <br>
//!           (the only one by default), and another form, the original <br>
//!           form, which can be different if it contains values to be <br>
//!           inserted (integers, reals, strings) <br>
//!           The original form can be more suitable for some operations <br>
//!           such as counting messages <br>
class Interface_Check : public MMgt_TShared {

public:

  //! Allows definition of a Sequence. Used also for Global Check <br>
//!           of an InterfaceModel (which stores global messages for file) <br>
  Standard_EXPORT   Interface_Check();
  //! Defines a Check on an Entity <br>
  Standard_EXPORT   Interface_Check(const Handle(Standard_Transient)& anentity);
  //! New name for AddFail (Msg) <br>
  Standard_EXPORT     void SendFail(const Message_Msg& amsg) ;
  //! Records a new Fail message <br>
  Standard_EXPORT     void AddFail(const Handle(TCollection_HAsciiString)& amess) ;
  //! Records a new Fail message under two forms : final,original <br>
  Standard_EXPORT     void AddFail(const Handle(TCollection_HAsciiString)& amess,const Handle(TCollection_HAsciiString)& orig) ;
  //! Records a new Fail message given as "error text" directly <br>
//!           If <orig> is given, a distinct original form is recorded <br>
//!           else (D), the original form equates <amess> <br>
  Standard_EXPORT     void AddFail(const Standard_CString amess,const Standard_CString orig = "") ;
  //! Records a new Fail from the definition of a Msg (Original+Value) <br>
  Standard_EXPORT     void AddFail(const Message_Msg& amsg) ;
  //! Returns True if Check brings at least one Fail Message <br>
  Standard_EXPORT     Standard_Boolean HasFailed() const;
  //! Returns count of recorded Fails <br>
  Standard_EXPORT     Standard_Integer NbFails() const;
  //! Returns Fail Message as a String <br>
//!           Final form by default, Original form if <final> is False <br>
  Standard_EXPORT    const Handle_TCollection_HAsciiString& Fail(const Standard_Integer num,const Standard_Boolean final = Standard_True) const;
  //! Same as above, but returns a CString (to be printed ...) <br>
//!           Final form by default, Original form if <final> is False <br>
  Standard_EXPORT     Standard_CString CFail(const Standard_Integer num,const Standard_Boolean final = Standard_True) const;
  //! Returns the list of Fails, for a frontal-engine logic <br>
//!           Final forms by default, Original forms if <final> is False <br>
//!           Can be empty <br>
  Standard_EXPORT     Handle_TColStd_HSequenceOfHAsciiString Fails(const Standard_Boolean final = Standard_True) const;
  //! New name for AddWarning <br>
  Standard_EXPORT     void SendWarning(const Message_Msg& amsg) ;
  //! Records a new Warning message <br>
  Standard_EXPORT     void AddWarning(const Handle(TCollection_HAsciiString)& amess) ;
  //! Records a new Warning message under two forms : final,original <br>
  Standard_EXPORT     void AddWarning(const Handle(TCollection_HAsciiString)& amess,const Handle(TCollection_HAsciiString)& orig) ;
  //! Records a Warning message given as "warning message" directly <br>
//!           If <orig> is given, a distinct original form is recorded <br>
//!           else (D), the original form equates <amess> <br>
  Standard_EXPORT     void AddWarning(const Standard_CString amess,const Standard_CString orig = "") ;
  //! Records a new Warning from the definition of a Msg (Original+Value) <br>
  Standard_EXPORT     void AddWarning(const Message_Msg& amsg) ;
  //! Returns True if Check brings at least one Warning Message <br>
  Standard_EXPORT     Standard_Boolean HasWarnings() const;
  //! Returns count of recorded Warning messages <br>
  Standard_EXPORT     Standard_Integer NbWarnings() const;
  //! Returns Warning message as a String <br>
//!           Final form by default, Original form if <final> is False <br>
  Standard_EXPORT    const Handle_TCollection_HAsciiString& Warning(const Standard_Integer num,const Standard_Boolean final = Standard_True) const;
  //! Same as above, but returns a CString (to be printed ...) <br>
//!           Final form by default, Original form if <final> is False <br>
  Standard_EXPORT     Standard_CString CWarning(const Standard_Integer num,const Standard_Boolean final = Standard_True) const;
  //! Returns the list of Warnings, for a frontal-engine logic <br>
//!           Final forms by default, Original forms if <final> is False <br>
//!           Can be empty <br>
  Standard_EXPORT     Handle_TColStd_HSequenceOfHAsciiString Warnings(const Standard_Boolean final = Standard_True) const;
  //! Records an information message <br>
//!           This does not change the status of the Check <br>
  Standard_EXPORT     void SendMsg(const Message_Msg& amsg) ;
  //! Returns the count of recorded information messages <br>
  Standard_EXPORT     Standard_Integer NbInfoMsgs() const;
  //! Returns information message as a String <br>
  Standard_EXPORT    const Handle_TCollection_HAsciiString& InfoMsg(const Standard_Integer num,const Standard_Boolean final = Standard_True) const;
  //! Same as above, but returns a CString (to be printed ...) <br>
//!           Final form by default, Original form if <final> is False <br>
  Standard_EXPORT     Standard_CString CInfoMsg(const Standard_Integer num,const Standard_Boolean final = Standard_True) const;
  //! Returns the list of Info Msg, for a frontal-engine logic <br>
//!           Final forms by default, Original forms if <final> is False <br>
//!           Can be empty <br>
  Standard_EXPORT     Handle_TColStd_HSequenceOfHAsciiString InfoMsgs(const Standard_Boolean final = Standard_True) const;
  //! Returns the Check Status : OK, Warning or Fail <br>
  Standard_EXPORT     Interface_CheckStatus Status() const;
  //! Tells if Check Status complies with a given one <br>
//!           (i.e. also status for query) <br>
  Standard_EXPORT     Standard_Boolean Complies(const Interface_CheckStatus status) const;
  //! Tells if a message is brought by a Check, as follows : <br>
//!           <incl> = 0 : <mess> exactly matches one of the messages <br>
//!           <incl> < 0 : <mess> is contained by one of the messages <br>
//!           <incl> > 0 : <mess> contains one of the messages <br>
//!           For <status> : for CheckWarning and CheckFail, considers only <br>
//!             resp. Warning or Check messages. for CheckAny, considers all <br>
//!             other values are ignored (answer will be false) <br>
  Standard_EXPORT     Standard_Boolean Complies(const Handle(TCollection_HAsciiString)& mess,const Standard_Integer incl,const Interface_CheckStatus status) const;
  //! Returns True if a Check is devoted to an entity; else, it is <br>
//!           global (for InterfaceModel's storing of global error messages) <br>
  Standard_EXPORT     Standard_Boolean HasEntity() const;
  //! Returns the entity on which the Check has been defined <br>
  Standard_EXPORT    const Handle_Standard_Transient& Entity() const;
  //! Clears a check, in order to receive informations from transfer <br>
//!           (Messages and Entity) <br>
  Standard_EXPORT     void Clear() ;
  //! Clears the Fail Messages (for instance to keep only Warnings) <br>
  Standard_EXPORT     void ClearFails() ;
  //! Clears the Warning Messages (for instance to keep only Fails) <br>
  Standard_EXPORT     void ClearWarnings() ;
  //! Clears the Info Messages <br>
  Standard_EXPORT     void ClearInfoMsgs() ;
  //! Removes the messages which comply with <mess>, as follows : <br>
//!           <incl> = 0 : <mess> exactly matches one of the messages <br>
//!           <incl> < 0 : <mess> is contained by one of the messages <br>
//!           <incl> > 0 : <mess> contains one of the messages <br>
//!           For <status> : for CheckWarning and CheckFail, considers only <br>
//!             resp. Warning or Check messages. for CheckAny, considers all <br>
//!             other values are ignored (nothing is done) <br>
//!           Returns True if at least one message has been removed, False else <br>
  Standard_EXPORT     Standard_Boolean Remove(const Handle(TCollection_HAsciiString)& mess,const Standard_Integer incl,const Interface_CheckStatus status) ;
  //! Mends messages, according <pref> and <num> <br>
//!           According to <num>, works on the whole list of Fails if = 0(D) <br>
//!             or only one Fail message, given its rank <br>
//!           If <pref> is empty, converts Fail(s) to Warning(s) <br>
//!           Else, does the conversion but prefixes the new Warning(s) but <br>
//!           <pref> followed by a semi-column <br>
//!           Some reserved values of <pref> are : <br>
//!           "FM" : standard prefix "Mended" (can be translated) <br>
//!           "CF" : clears Fail(s) <br>
//!           "CW" : clears Warning(s) : here, <num> refers to Warning list <br>
//!           "CA" : clears all messages : here, <num> is ignored <br>
  Standard_EXPORT     Standard_Boolean Mend(const Standard_CString pref,const Standard_Integer num = 0) ;
  //! Receives an entity result of a Transfer <br>
  Standard_EXPORT     void SetEntity(const Handle(Standard_Transient)& anentity) ;
  //! same as SetEntity (old form kept for compatibility) <br>
//! Warning : Does nothing if Entity field is not yet clear <br>
  Standard_EXPORT     void GetEntity(const Handle(Standard_Transient)& anentity) ;
  //! Copies messages stored in another Check, cumulating <br>
//!           Does not regard other's Entity. Used to cumulate messages <br>
  Standard_EXPORT     void GetMessages(const Handle(Interface_Check)& other) ;
  //! Copies messages converted into Warning messages <br>
//!           If failsonly is true, only Fails are taken, and converted <br>
//!           else, Warnings are taken too. Does not regard Entity <br>
//!           Used to keep Fail messages as Warning, after a recovery <br>
  Standard_EXPORT     void GetAsWarning(const Handle(Interface_Check)& other,const Standard_Boolean failsonly) ;
  //! Prints the messages of the check to an Messenger <br>
//!           <level> = 1 : only fails <br>
//!           <level> = 2 : fails and warnings <br>
//!           <level> = 3 : all (fails, warnings, info msg) <br>
//!           <final> : if positive (D) prints final values of messages <br>
//!           if negative, prints originals <br>
//!           if null, prints both forms <br>
  Standard_EXPORT     void Print(const Handle(Message_Messenger)& S,const Standard_Integer level,const Standard_Integer final = 1) const;
  //! Prints the messages of the check to the default trace file <br>
//!           By default, according to the default standard level <br>
//!           Else, according level (see method Print) <br>
  Standard_EXPORT     void Trace(const Standard_Integer level = -1,const Standard_Integer final = 1) const;




  DEFINE_STANDARD_RTTI(Interface_Check)

protected:




private: 


Handle_TColStd_HSequenceOfHAsciiString thefails;
Handle_TColStd_HSequenceOfHAsciiString thefailo;
Handle_TColStd_HSequenceOfHAsciiString thewarns;
Handle_TColStd_HSequenceOfHAsciiString thewarno;
Handle_TColStd_HSequenceOfHAsciiString theinfos;
Handle_TColStd_HSequenceOfHAsciiString theinfoo;
Handle_Standard_Transient theent;


};





// other Inline functions and methods (like "C++: function call" methods)


#endif