Tag Parser
6.3.0
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) {
31
case
NotificationType::Information
:
32
return
"information"
;
33
case
NotificationType::Warning
:
34
return
"warning"
;
35
case
NotificationType::Critical
:
36
return
"critical"
;
37
case
NotificationType::None
:
38
default
:
39
return
""
;
40
}
41
}
42
46
void
Notification::sortByTime
(
NotificationList
¬ifications)
47
{
48
notifications.sort([] (
const
Notification
&first,
const
Notification
&second) {
49
return
first.
creationTime
() < second.
creationTime
();
50
});
51
}
52
53
}
Media::Notification::sortByTime
static void sortByTime(NotificationList ¬ifications)
Sorts the specified notifications by time (ascending).
Definition:
notification.cpp:46
Media::NotificationType
NotificationType
Specifies the notification type.
Definition:
notification.h:18
ChronoUtilities
std
STL namespace.
notification.h
Media::RawDataType::DateTime
Definition:
mp4tagfield.h:38
Media::Notification::creationTime
const ChronoUtilities::DateTime & creationTime() const
Returns the time when the notification originally was created.
Definition:
notification.h:90
Media::NotificationType::Critical
Media::Notification::typeName
const char * typeName() const
Returns the notification type as C-style string.
Definition:
notification.cpp:28
Media::NotificationList
std::list< Notification > NotificationList
Definition:
notification.h:39
Media::Notification
The Notification class holds a notification message of a certain notification type.
Definition:
notification.h:43
Media
Contains all classes and functions of the TagInfo library.
Definition:
exceptions.h:9
Media::NotificationType::Warning
Media::Mp4TagContentRating::None
Media::NotificationType::Information
Generated on Wed May 31 2017 10:18:00 for Tag Parser by
1.8.13