00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef NOTIFYCATEGORY_H
00020 #define NOTIFYCATEGORY_H
00021
00022 #include "dtoolbase.h"
00023
00024 #include "notifySeverity.h"
00025
00026 #include <vector>
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 class EXPCL_DTOOLCONFIG NotifyCategory {
00038 private:
00039 NotifyCategory(const string &fullname, const string &basename,
00040 NotifyCategory *parent);
00041
00042 PUBLISHED:
00043 INLINE string get_fullname() const;
00044 INLINE string get_basename() const;
00045 INLINE NotifySeverity get_severity() const;
00046 INLINE void set_severity(NotifySeverity severity);
00047
00048 INLINE bool is_on(NotifySeverity severity) const;
00049
00050
00051
00052
00053
00054
00055
00056 #if defined(NOTIFY_DEBUG) || defined(CPPPARSER)
00057 INLINE bool is_spam() const;
00058 INLINE bool is_debug() const;
00059 #else
00060 INLINE static bool is_spam();
00061 INLINE static bool is_debug();
00062 #endif
00063 INLINE bool is_info() const;
00064 INLINE bool is_warning() const;
00065 INLINE bool is_error() const;
00066 INLINE bool is_fatal() const;
00067
00068 ostream &out(NotifySeverity severity, bool prefix = true) const;
00069 INLINE ostream &spam(bool prefix = true) const;
00070 INLINE ostream &debug(bool prefix = true) const;
00071 INLINE ostream &info(bool prefix = true) const;
00072 INLINE ostream &warning(bool prefix = true) const;
00073 INLINE ostream &error(bool prefix = true) const;
00074 INLINE ostream &fatal(bool prefix = true) const;
00075
00076 int get_num_children() const;
00077 NotifyCategory *get_child(int i) const;
00078
00079 static void set_server_delta(time_t delta);
00080
00081 private:
00082 string _fullname;
00083 string _basename;
00084 NotifyCategory *_parent;
00085 NotifySeverity _severity;
00086 typedef vector<NotifyCategory *> Children;
00087 Children _children;
00088
00089 static time_t _server_delta;
00090
00091 friend class Notify;
00092 };
00093
00094 INLINE ostream &operator << (ostream &out, const NotifyCategory &cat) {
00095 return out << cat.get_fullname();
00096 }
00097
00098 #include "notifyCategory.I"
00099
00100 #endif