Xavax C++ Library Class Index   FAQ   Overview

Class xavax::Message

Message is the transient representation of a message in a message catalog. Messages are contained within a message set. A message has the following attributes.

Attribute Description
default text text provided by the programmer or message editor which is compiled into the program and used when the message catalog file is not available.
length the length of the message catalog text.
message number a numeric identifier that is unique within a message set.
offset the offset of the text for this message within the text data block read from the message catalog.
text the message text read from the message catalog.

Constructor Summary
Message(const MessageData* msgData)
         Construct a Message object.
Message(UInt16 msgNumber, UInt16 length, UInt32 offset)
         Construct a Message object.

Method Summary
const char* defaultText() const
         Return the default text for this message.
UInt16 length() const
         Return the message length.
UInt16 msgnum() const
         Return the message number.
UInt32 offset() const
         Return the offset for this message.
const char* text() const
         Return the text for this message.

Related Classes
MessageCatalog, MessageSet

Constructor Detail

Message

Message(const MessageData* msgData)
Construct a Message object from default message data. This constructor is used by MessageCatalog when loading default catalog data produced by the message editor.
Parameters:
msgData - default data for this message.

Message

Message(UInt16 msgNumber, UInt16 length, UInt32 offset)
Construct a Message object. This constructor is used by MessageCatalog when loading the message catalog file.
Parameters:
msgNumber - the message number for this message.
length - the length of this message.
offset - the offset of this message within the text read from the message catalog.

Method Detail

defaultText

const char* defaultText() const
Return the default text for this message. The default text is used when the message catalog file is not available.
Returns:
the default text for this message.

length

UInt16 length() const
Return the length of this message.
Returns:
the length of this message.

msgnum

UInt16 msgnum() const
Return the message number of this message.
Returns:
the message number of this message.

offset

UInt32 offset() const
Return the offset of the message text within the text block read from the message catalog file.
Returns:
the offset of this message.

text

const char* text() const
Return the text for this message. If the message catalog file is not available, the default text is returned.
Returns:
the text for this message.

Example Code

See MessageCatalog for example code.

Copyright © 2003 Xavax Inc. -- All Rights Reserved