1 -- File: Message_Msg.cdl
2 -- Created: 18.01.01 16:55:51
4 ---Copyright: Open CASCADE S.A. 2005
9 ---Purpose: This class provides a tool for constructing the parametrized message
10 -- basing on resources loaded by Message_MsgFile tool.
12 -- A Message is created from a keyword: this keyword identifies the
13 -- message in a message file that should be previously loaded by call
14 -- to Message_MsgFile::LoadFile().
16 -- The text of the message can contain placeholders for the parameters
17 -- which are to be filled by the proper values when the message
18 -- is prepared. Most of the format specifiers used in C can be used,
19 -- for instance, %s for string, %d for integer etc. In addition,
20 -- specifier %f is supported for double numbers (for compatibility
21 -- with previous versions).
23 -- User fills the parameter fields in the text of the message by
24 -- calling corresponding methods Arg() or operators "<<".
26 -- The resulting message, filled with all parameters, can be obtained
27 -- by method Get(). If some parameters were not filled, the text
28 -- UNKNOWN is placed instead.
32 AsciiString from TCollection,
33 HAsciiString from TCollection,
34 ExtendedString from TCollection,
35 HExtendedString from TCollection,
36 SequenceOfInteger from TColStd
40 Create returns Msg from Message;
41 ---Purpose : Empty constructor
43 Create (theMsg: Msg from Message) returns Msg from Message;
44 ---Purpose : Copy constructor
46 Create (theKey: CString) returns Msg from Message;
47 ---Purpose : Create a message using a corresponding entry in Message_MsgFile
49 Create (theKey: ExtendedString from TCollection) returns Msg from Message;
50 ---Purpose : Create a message using a corresponding entry in Message_MsgFile
52 Set (me: in out; theMsg: CString);
53 ---Purpose : Set a message body text -- can be used as alternative to
54 -- using messages from resource file
56 Set (me: in out; theMsg: ExtendedString from TCollection);
57 ---Purpose : Set a message body text -- can be used as alternative to
58 -- using messages from resource file
62 Arg (me: in out; theString : CString)
63 returns Msg from Message;
65 ---C++: alias operator <<
66 ---Purpose : Set a value for %..s conversion
68 Arg (me: in out; theString : AsciiString from TCollection)
69 returns Msg from Message;
72 ---C++: alias operator <<
73 ---Purpose : Set a value for %..s conversion
75 Arg (me: in out; theString : HAsciiString from TCollection)
76 returns Msg from Message;
79 ---C++: alias operator <<
80 ---Purpose : Set a value for %..s conversion
82 Arg (me: in out; theString : ExtendedString from TCollection)
83 returns Msg from Message;
85 ---C++: alias operator <<
86 ---Purpose : Set a value for %..s conversion
88 Arg (me: in out; theString : HExtendedString from TCollection)
89 returns Msg from Message;
92 ---C++: alias operator <<
93 ---Purpose : Set a value for %..s conversion
95 Arg (me: in out; theInt : Integer)
96 returns Msg from Message;
98 ---C++: alias operator <<
99 ---Purpose : Set a value for %..d, %..i, %..o, %..u, %..x or %..X conversion
101 Arg (me: in out; theReal : Real)
102 returns Msg from Message;
104 ---C++: alias operator <<
105 ---Purpose : Set a value for %..f, %..e, %..E, %..g or %..G conversion
107 Original (me) returns ExtendedString from TCollection;
109 ---C++: return const &
110 ---Purpose : Returns the original message text
112 Value (me) returns ExtendedString from TCollection;
114 ---C++: return const &
115 ---Purpose : Returns current state of the message text with
116 -- parameters to the moment
118 IsEdited (me) returns Boolean;
120 ---Purpose : Tells if Value differs from Original
123 returns ExtendedString from TCollection;
124 ---C++: return const &
125 ---C++: alias "operator const TCollection_ExtendedString& () { return Get(); }"
126 ---Purpose : Return the resulting message string with all parameters
127 -- filled. If some parameters were not yet filled by calls
128 -- to methods Arg (or <<), these parameters are filled by
133 getFormat (me: in out; theType : Integer;
134 theFormat : in out AsciiString from TCollection)
135 returns Integer is private;
137 replaceText (me: in out; theFirst : Integer;
139 theStr : ExtendedString from TCollection) is private;
143 myOriginal : ExtendedString from TCollection;
144 myMessageBody : ExtendedString from TCollection;
145 mySeqOfFormats : SequenceOfInteger from TColStd;