Public Types | Public Member Functions | Private Attributes | Friends | List of all members
mf::ELseverityLevel Class Reference

#include <ELseverityLevel.h>

Public Types

enum  ELsev_ {
  ELsev_noValueAssigned, ELsev_zeroSeverity, ELsev_success, ELsev_info,
  ELsev_warning, ELsev_error, ELsev_unspecified, ELsev_severe,
  ELsev_highestSeverity, nLevels
}
 

Public Member Functions

constexpr ELseverityLevel (ELsev_ lev=ELsev_unspecified)
 
 ELseverityLevel (std::string const &str)
 
int cmp (ELseverityLevel e) const
 
int getLevel () const
 
std::string getSymbol () const
 
std::string getName () const
 
std::string getInputStr () const
 
std::string getVarName () const
 

Private Attributes

int myLevel
 

Friends

std::ostream & operator<< (std::ostream &os, ELseverityLevel const sev)
 

Detailed Description

Definition at line 26 of file ELseverityLevel.h.

Member Enumeration Documentation

Enumerator
ELsev_noValueAssigned 
ELsev_zeroSeverity 
ELsev_success 
ELsev_info 
ELsev_warning 
ELsev_error 
ELsev_unspecified 
ELsev_severe 
ELsev_highestSeverity 
nLevels 

Definition at line 29 of file ELseverityLevel.h.

Constructor & Destructor Documentation

constexpr mf::ELseverityLevel::ELseverityLevel ( ELsev_  lev = ELsev_unspecified)
inline

Definition at line 63 of file ELseverityLevel.h.

mf::ELseverityLevel::ELseverityLevel ( std::string const &  str)

Definition at line 50 of file ELseverityLevel.cc.

51  {
52  static map<string const, mf::ELseverityLevel::ELsev_> const& m = loadMap();
53  auto i = m.find(s);
54  myLevel = (i == m.end()) ? ELsev_unspecified : i->second;
55  }
static QCString * s
Definition: config.cpp:1042

Member Function Documentation

int mf::ELseverityLevel::cmp ( ELseverityLevel  e) const

Definition at line 58 of file ELseverityLevel.cc.

59  {
60  return myLevel - e.myLevel;
61  }
const double e
string mf::ELseverityLevel::getInputStr ( ) const

Definition at line 142 of file ELseverityLevel.cc.

143  {
144  string result;
145  switch (myLevel) {
146  default:
147  result = "?no value?";
148  break;
149  case ELsev_zeroSeverity:
150  result = "ZERO";
151  break;
152  case ELsev_success:
153  result = "DEBUG";
154  break;
155  case ELsev_info:
156  result = "INFO";
157  break;
158  case ELsev_warning:
159  result = "WARNING";
160  break;
161  case ELsev_error:
162  result = "ERROR";
163  break;
164  case ELsev_unspecified:
165  result = "UNSPECIFIED";
166  break;
167  case ELsev_severe:
168  result = "SYSTEM";
169  break;
171  result = "HIGHEST";
172  break;
173  }
174  return result;
175  }
static QCString result
int mf::ELseverityLevel::getLevel ( ) const

Definition at line 64 of file ELseverityLevel.cc.

65  {
66  return myLevel;
67  }
string mf::ELseverityLevel::getName ( ) const

Definition at line 106 of file ELseverityLevel.cc.

107  {
108  string result;
109  switch (myLevel) {
110  default:
111  result = "?no value?";
112  break;
113  case ELsev_zeroSeverity:
114  result = "--";
115  break;
116  case ELsev_success:
117  result = "Debug";
118  break;
119  case ELsev_info:
120  result = "Info";
121  break;
122  case ELsev_warning:
123  result = "Warning";
124  break;
125  case ELsev_error:
126  result = "Error";
127  break;
128  case ELsev_unspecified:
129  result = "??";
130  break;
131  case ELsev_severe:
132  result = "System";
133  break;
135  result = "!!";
136  break;
137  }
138  return result;
139  }
static QCString result
string mf::ELseverityLevel::getSymbol ( ) const

Definition at line 70 of file ELseverityLevel.cc.

71  {
72  string result;
73  switch (myLevel) {
74  default:
75  result = "0";
76  break;
77  case ELsev_zeroSeverity:
78  result = "--";
79  break;
80  case ELsev_success:
81  result = "-d";
82  break;
83  case ELsev_info:
84  result = "-i";
85  break;
86  case ELsev_warning:
87  result = "-w";
88  break;
89  case ELsev_error:
90  result = "-e";
91  break;
92  case ELsev_unspecified:
93  result = "??";
94  break;
95  case ELsev_severe:
96  result = "-s";
97  break;
99  result = "!!";
100  break;
101  }
102  return result;
103  }
static QCString result
string mf::ELseverityLevel::getVarName ( ) const

Definition at line 178 of file ELseverityLevel.cc.

179  {
180  string result;
181  switch (myLevel) {
182  default:
183  result = "?no value? ";
184  break;
185  case ELsev_zeroSeverity:
186  result = "ELzeroSeverity ";
187  break;
188  case ELsev_success:
189  result = "ELdebug ";
190  break;
191  case ELsev_info:
192  result = "ELinfo ";
193  break;
194  case ELsev_warning:
195  result = "ELwarning ";
196  break;
197  case ELsev_error:
198  result = "ELerror ";
199  break;
200  case ELsev_unspecified:
201  result = "ELunspecified ";
202  break;
203  case ELsev_severe:
204  result = "ELsystem ";
205  break;
207  result = "ELhighestSeverity";
208  break;
209  }
210  return result;
211  }
static QCString result

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
ELseverityLevel const  sev 
)
friend

Definition at line 214 of file ELseverityLevel.cc.

215  {
216  return os << " -" << sev.getName() << "- ";
217  }

Member Data Documentation

int mf::ELseverityLevel::myLevel
private

Definition at line 60 of file ELseverityLevel.h.


The documentation for this class was generated from the following files: