1 #ifndef MESSAGEFACILITY_EXTENSIONS_QT_MF_MSG_H
2 #define MESSAGEFACILITY_EXTENSIONS_QT_MF_MSG_H
7 #include <QtCore/QString>
8 #include <QtGui/QColor>
19 class MessageFacilityMsg;
43 explicit qt_mf_msg(mf::MessageFacilityMsg
const& msg);
51 QString
const&
text(
bool mode)
const {
return mode ? shortText_ : text_; }
56 QColor
const&
color()
const {
return color_; }
61 sev_code_t
sev()
const {
return sev_; }
66 QString
const&
host()
const {
return host_; }
71 QString
const&
cat()
const {
return cat_; }
76 QString
const&
app()
const {
return app_; }
81 timeval
time()
const {
return time_; }
86 size_t seq()
const {
return seq_; }
99 static size_t sequence;
105 typedef std::list<qt_mf_msg> msgs_t;
131 return seq_ == other.seq_;
141 return seq_ < other.seq_;
148 msgs_t::iterator
get()
const {
return iter_; };
153 msgs_t::iterator iter_;
160 typedef std::list<msg_iter_t> msg_iters_t;
164 typedef std::map<QString, msg_iters_t> msg_iters_map_t;
QString const & app() const
Get the application of the message
timeval time() const
Get the message timestamp
size_t seq() const
Get the sequence number of the message
qt_mf_msg(mf::MessageFacilityMsg const &msg)
Construct a qt_mf_msg using the given MessageFacilityMsg
Qt wrapper around MessageFacility message
sev_code_t sev() const
Get the severity of the message
msg_iter_t(msgs_t::iterator it)
Construct a msg_iter_t
QString const & host() const
Get the host from which the message came
bool operator<(msg_iter_t const &other) const
Comparison operator, based on message sequence number
Iterator for the msgs_t type
QString const & text(bool mode) const
Get the text of the message
QString const & cat() const
Get the category of the message
bool operator==(msg_iter_t const &other) const
Equality operator. Equality is based on the message's sequence number
QColor const & color() const
Get the severity-based color of the message