summaryrefslogtreecommitdiff
path: root/includes/image_io/base/message.h
diff options
context:
space:
mode:
Diffstat (limited to 'includes/image_io/base/message.h')
-rw-r--r--includes/image_io/base/message.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/includes/image_io/base/message.h b/includes/image_io/base/message.h
index 8c225d8..fef2fd6 100644
--- a/includes/image_io/base/message.h
+++ b/includes/image_io/base/message.h
@@ -15,6 +15,9 @@ class Message {
/// A Status message.
kStatus,
+ /// A Warning message.
+ kWarning,
+
/// An error from the stdlib was detected. The std::errno variable can be
/// used to programmatically decide what to do, or use the std::strerror
/// function to get a string description of the error.
@@ -66,6 +69,17 @@ class Message {
/// @return The text of the message.
const std::string& GetText() const { return text_; }
+ /// @return Whether the message is an error message.
+ bool IsError() const {
+ return type_ != Message::kStatus && type_ != Message::kWarning;
+ }
+
+ /// @return Whether the message is a warning message.
+ bool IsWarning() const { return type_ == Message::kWarning; }
+
+ /// @return Whether the message is a status message.
+ bool IsStatus() const { return type_ == Message::kStatus; }
+
private:
/// The type of message.
Type type_;