Tag Parser  6.5.1
C++ library for reading and writing MP4 (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags
notification.cpp
Go to the documentation of this file.
1 #include "./notification.h"
2 
3 using namespace std;
4 using namespace ChronoUtilities;
5 
6 namespace Media {
7 
18 Notification::Notification(NotificationType type, const string &message, const string &context) :
19  m_type(type),
20  m_msg(message),
21  m_context(context),
22  m_creationTime(DateTime::now())
23 {}
24 
28 const char *Notification::typeName() const
29 {
30  switch(m_type) {
32  return "information";
34  return "warning";
36  return "critical";
38  default:
39  return "";
40  }
41 }
42 
47 {
48  notifications.sort([] (const Notification &first, const Notification &second) {
49  return first.creationTime() < second.creationTime();
50  });
51 }
52 
53 }
static void sortByTime(NotificationList &notifications)
Sorts the specified notifications by time (ascending).
NotificationType
Specifies the notification type.
Definition: notification.h:18
STL namespace.
const ChronoUtilities::DateTime & creationTime() const
Returns the time when the notification originally was created.
Definition: notification.h:91
const char * typeName() const
Returns the notification type as C-style string.
std::list< Notification > NotificationList
Definition: notification.h:39
The Notification class holds a notification message of a certain notification type.
Definition: notification.h:43
Contains all classes and functions of the TagInfo library.
Definition: exceptions.h:9