Panda3D
Loading...
Searching...
No Matches
notifySeverity.cxx
Go to the documentation of this file.
1/**
2 * PANDA 3D SOFTWARE
3 * Copyright (c) Carnegie Mellon University. All rights reserved.
4 *
5 * All use of this software is subject to the terms of the revised BSD
6 * license. You should have received a copy of this license along
7 * with this source code in a file named "LICENSE."
8 *
9 * @file notifySeverity.cxx
10 * @author drose
11 * @date 2000-02-29
12 */
13
14#include "notifySeverity.h"
15#include "pnotify.h"
16
17using std::istream;
18using std::ostream;
19using std::string;
20
21ostream &
22operator << (ostream &out, NotifySeverity severity) {
23 switch (severity) {
24 case NS_spam:
25 return out << "spam";
26
27 case NS_debug:
28 return out << "debug";
29
30 case NS_info:
31 return out << "info";
32
33 case NS_warning:
34 return out << "warning";
35
36 case NS_error:
37 return out << "error";
38
39 case NS_fatal:
40 return out << "fatal";
41
42 case NS_unspecified:
43 return out << "unspecified";
44 }
45
46 return out << "**invalid severity**";
47}
48
49istream &
50operator >> (istream &in, NotifySeverity &severity) {
51 string word;
52 in >> word;
53 severity = Notify::string_severity(word);
54 return in;
55}
static NotifySeverity string_severity(const std::string &string)
Given a string, one of "debug", "info", "warning", etc., return the corresponding Severity level,...
Definition notify.cxx:390
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.