Panda3D
|
00001 // Filename: notifySeverity.cxx 00002 // Created by: drose (29Feb00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #include "notifySeverity.h" 00016 #include "pnotify.h" 00017 00018 ostream & 00019 operator << (ostream &out, NotifySeverity severity) { 00020 switch (severity) { 00021 case NS_spam: 00022 return out << "spam"; 00023 00024 case NS_debug: 00025 return out << "debug"; 00026 00027 case NS_info: 00028 return out << "info"; 00029 00030 case NS_warning: 00031 return out << "warning"; 00032 00033 case NS_error: 00034 return out << "error"; 00035 00036 case NS_fatal: 00037 return out << "fatal"; 00038 00039 case NS_unspecified: 00040 return out << "unspecified"; 00041 } 00042 00043 return out << "**invalid severity**"; 00044 } 00045 00046 istream & 00047 operator >> (istream &in, NotifySeverity &severity) { 00048 string word; 00049 in >> word; 00050 severity = Notify::string_severity(word); 00051 return in; 00052 }