0023072: Eliminate compiler warnings (level 3) on Windows / MSVC++
[occt.git] / src / Message / Message_Msg.cdl
1 -- Created on: 2001-01-18
2 -- Created by: OCC Team
3 -- Copyright (c) 2001-2012 OPEN CASCADE SAS
4 --
5 -- The content of this file is subject to the Open CASCADE Technology Public
6 -- License Version 6.5 (the "License"). You may not use the content of this file
7 -- except in compliance with the License. Please obtain a copy of the License
8 -- at http://www.opencascade.org and read it completely before using this file.
9 --
10 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 --
13 -- The Original Code and all software distributed under the License is
14 -- distributed on an "AS IS" basis, without warranty of any kind, and the
15 -- Initial Developer hereby disclaims all such warranties, including without
16 -- limitation, any warranties of merchantability, fitness for a particular
17 -- purpose or non-infringement. Please see the License for the specific terms
18 -- and conditions governing the rights and limitations under the License.
19
20
21
22 class Msg  from Message
23
24     ---Purpose: This class provides a tool for constructing the parametrized message
25     --          basing on resources loaded by Message_MsgFile tool.
26     --           
27     --          A Message is created from a keyword: this keyword identifies the 
28     --          message in a message file that should be previously loaded by call
29     --          to Message_MsgFile::LoadFile(). 
30     --          
31     --          The text of the message can contain placeholders for the parameters
32     --          which are to be filled by the proper values when the message 
33     --          is prepared. Most of the format specifiers used in C can be used,
34     --          for instance, %s for string, %d for integer etc. In addition,
35     --          specifier %f is supported for double numbers (for compatibility
36     --          with previous versions).
37     --          
38     --          User fills the parameter fields in the text of the message by 
39     --          calling corresponding methods Arg() or operators "<<".
40     --          
41     --          The resulting message, filled with all parameters, can be obtained
42     --          by method Get(). If some parameters were not filled, the text
43     --          UNKNOWN is placed instead.
44
45 uses
46
47     AsciiString  from TCollection,
48     HAsciiString  from TCollection,
49     ExtendedString from TCollection,
50     HExtendedString from TCollection,
51     SequenceOfInteger from TColStd
52
53 is
54
55     Create returns Msg from Message;
56         ---Purpose : Empty constructor
57
58     Create (theMsg: Msg from Message) returns Msg from Message;
59         ---Purpose : Copy constructor
60
61     Create (theKey: CString) returns Msg from Message;
62         ---Purpose : Create a message using a corresponding entry in Message_MsgFile
63
64     Create (theKey: ExtendedString from TCollection) returns Msg from Message;
65         ---Purpose : Create a message using a corresponding entry in Message_MsgFile
66
67     Set (me: in out; theMsg: CString);
68         ---Purpose : Set a message body text -- can be used as alternative to 
69         --           using messages from resource file
70
71     Set (me: in out; theMsg: ExtendedString from TCollection);
72         ---Purpose : Set a message body text -- can be used as alternative to 
73         --           using messages from resource file
74
75     -- Adding arguments
76
77     Arg (me: in out; theString : CString)
78     returns Msg from Message;
79         ---C++: return &
80         ---C++: alias operator <<
81         ---Purpose : Set a value for %..s conversion
82     
83     Arg (me: in out; theString : AsciiString from TCollection)
84     returns Msg from Message;
85         ---C++: return &
86         ---C++: inline
87         ---C++: alias operator <<
88         ---Purpose : Set a value for %..s conversion
89
90     Arg (me: in out; theString : HAsciiString from TCollection)
91     returns Msg from Message;
92         ---C++: return &
93         ---C++: inline
94         ---C++: alias operator <<
95         ---Purpose : Set a value for %..s conversion
96
97     Arg (me: in out; theString : ExtendedString from TCollection)
98     returns Msg from Message;
99         ---C++: return &
100         ---C++: alias operator <<
101         ---Purpose : Set a value for %..s conversion
102
103     Arg (me: in out; theString : HExtendedString from TCollection)
104     returns Msg from Message;
105         ---C++: return &
106         ---C++: inline
107         ---C++: alias operator <<
108         ---Purpose : Set a value for %..s conversion
109
110     Arg (me: in out; theInt : Integer)
111     returns Msg from Message;
112         ---C++: return &
113         ---C++: alias operator <<
114         ---Purpose : Set a value for %..d, %..i, %..o, %..u, %..x or %..X conversion
115
116     Arg (me: in out; theReal : Real)
117     returns Msg from Message;
118         ---C++: return &
119         ---C++: alias operator <<
120         ---Purpose : Set a value for %..f, %..e, %..E, %..g or %..G conversion
121
122     Original (me) returns ExtendedString from TCollection;
123         ---C++: inline
124         ---C++: return const &
125         ---Purpose : Returns the original message text
126     
127     Value (me) returns ExtendedString from TCollection;
128         ---C++: inline
129         ---C++: return const &
130         ---Purpose : Returns current state of the message text with 
131         --           parameters to the moment
132     
133     IsEdited (me) returns Boolean;
134         ---C++: inline
135         ---Purpose : Tells if Value differs from Original
136     
137     Get (me: in out)
138     returns ExtendedString from TCollection;
139         ---C++: return const &
140         ---C++: alias "operator const TCollection_ExtendedString& () { return Get(); }"
141         ---Purpose : Return the resulting message string with all parameters
142         --           filled. If some parameters were not yet filled by calls
143         --           to methods Arg (or <<), these parameters are filled by
144         --           the word UNKNOWN
145
146     -- Private methods
147         
148     getFormat (me: in out; theType : Integer;
149                    theFormat : in out AsciiString from TCollection)
150     returns Integer is private;
151
152     replaceText (me: in out; theFirst : Integer;
153                              theNb    : Integer;
154                              theStr   : ExtendedString from TCollection) is private;
155
156 fields
157
158     myOriginal     : ExtendedString    from TCollection;
159     myMessageBody  : ExtendedString    from TCollection;
160     mySeqOfFormats : SequenceOfInteger from TColStd;
161
162 end Msg;