Open CASCADE Technology
7.6.0
|
This class provides a tool for constructing the parametrized message basing on resources loaded by Message_MsgFile tool. More...
#include <Message_Msg.hxx>
Public Member Functions | |
Message_Msg () | |
Empty constructor. More... | |
Message_Msg (const Message_Msg &theMsg) | |
Copy constructor. More... | |
Message_Msg (const Standard_CString theKey) | |
Create a message using a corresponding entry in Message_MsgFile. More... | |
Message_Msg (const TCollection_ExtendedString &theKey) | |
Create a message using a corresponding entry in Message_MsgFile. More... | |
void | Set (const Standard_CString theMsg) |
Set a message body text – can be used as alternative to using messages from resource file. More... | |
void | Set (const TCollection_ExtendedString &theMsg) |
Set a message body text – can be used as alternative to using messages from resource file. More... | |
Message_Msg & | Arg (const Standard_CString theString) |
Set a value for %..s conversion. More... | |
Message_Msg & | operator<< (const Standard_CString theString) |
Message_Msg & | Arg (const TCollection_AsciiString &theString) |
Set a value for %..s conversion. More... | |
Message_Msg & | operator<< (const TCollection_AsciiString &theString) |
Message_Msg & | Arg (const Handle< TCollection_HAsciiString > &theString) |
Set a value for %..s conversion. More... | |
Message_Msg & | operator<< (const Handle< TCollection_HAsciiString > &theString) |
Message_Msg & | Arg (const TCollection_ExtendedString &theString) |
Set a value for %..s conversion. More... | |
Message_Msg & | operator<< (const TCollection_ExtendedString &theString) |
Message_Msg & | Arg (const Handle< TCollection_HExtendedString > &theString) |
Set a value for %..s conversion. More... | |
Message_Msg & | operator<< (const Handle< TCollection_HExtendedString > &theString) |
Message_Msg & | Arg (const Standard_Integer theInt) |
Set a value for %..d, %..i, %..o, %..u, %..x or %..X conversion. More... | |
Message_Msg & | operator<< (const Standard_Integer theInt) |
Message_Msg & | Arg (const Standard_Real theReal) |
Set a value for %..f, %..e, %..E, %..g or %..G conversion. More... | |
Message_Msg & | operator<< (const Standard_Real theReal) |
const TCollection_ExtendedString & | Original () const |
Returns the original message text. More... | |
const TCollection_ExtendedString & | Value () const |
Returns current state of the message text with parameters to the moment. More... | |
Standard_Boolean | IsEdited () const |
Tells if Value differs from Original. More... | |
const TCollection_ExtendedString & | Get () |
Return the resulting message string with all parameters filled. If some parameters were not yet filled by calls to methods Arg (or <<), these parameters are filled by the word UNKNOWN. More... | |
operator const TCollection_ExtendedString & () | |
This class provides a tool for constructing the parametrized message basing on resources loaded by Message_MsgFile tool.
A Message is created from a keyword: this keyword identifies the message in a message file that should be previously loaded by call to Message_MsgFile::LoadFile().
The text of the message can contain placeholders for the parameters which are to be filled by the proper values when the message is prepared. Most of the format specifiers used in C can be used, for instance, s for string, d for integer etc. In addition, specifier f is supported for double numbers (for compatibility with previous versions).
User fills the parameter fields in the text of the message by calling corresponding methods Arg() or operators .
The resulting message, filled with all parameters, can be obtained by method Get(). If some parameters were not filled, the text UNKNOWN is placed instead.
Message_Msg::Message_Msg | ( | ) |
Empty constructor.
Message_Msg::Message_Msg | ( | const Message_Msg & | theMsg | ) |
Copy constructor.
Message_Msg::Message_Msg | ( | const Standard_CString | theKey | ) |
Create a message using a corresponding entry in Message_MsgFile.
Message_Msg::Message_Msg | ( | const TCollection_ExtendedString & | theKey | ) |
Create a message using a corresponding entry in Message_MsgFile.
Message_Msg& Message_Msg::Arg | ( | const Handle< TCollection_HAsciiString > & | theString | ) |
Set a value for %..s conversion.
Message_Msg& Message_Msg::Arg | ( | const Handle< TCollection_HExtendedString > & | theString | ) |
Set a value for %..s conversion.
Message_Msg& Message_Msg::Arg | ( | const Standard_CString | theString | ) |
Set a value for %..s conversion.
Message_Msg& Message_Msg::Arg | ( | const Standard_Integer | theInt | ) |
Set a value for %..d, %..i, %..o, %..u, %..x or %..X conversion.
Message_Msg& Message_Msg::Arg | ( | const Standard_Real | theReal | ) |
Set a value for %..f, %..e, %..E, %..g or %..G conversion.
Message_Msg& Message_Msg::Arg | ( | const TCollection_AsciiString & | theString | ) |
Set a value for %..s conversion.
Message_Msg& Message_Msg::Arg | ( | const TCollection_ExtendedString & | theString | ) |
Set a value for %..s conversion.
const TCollection_ExtendedString& Message_Msg::Get | ( | ) |
Return the resulting message string with all parameters filled. If some parameters were not yet filled by calls to methods Arg (or <<), these parameters are filled by the word UNKNOWN.
Standard_Boolean Message_Msg::IsEdited | ( | ) | const |
Tells if Value differs from Original.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
const TCollection_ExtendedString& Message_Msg::Original | ( | ) | const |
Returns the original message text.
void Message_Msg::Set | ( | const Standard_CString | theMsg | ) |
Set a message body text – can be used as alternative to using messages from resource file.
void Message_Msg::Set | ( | const TCollection_ExtendedString & | theMsg | ) |
Set a message body text – can be used as alternative to using messages from resource file.
const TCollection_ExtendedString& Message_Msg::Value | ( | ) | const |
Returns current state of the message text with parameters to the moment.