11const char*
const ers::Core::SEVERITY_NAMES[] = {
"none",
"debug_0",
"debug_1",
"debug_2",
"debug_3",
"information",
"notification",
"warning",
"error",
"fatal",
"maximum (illegal)" } ;
12const char*
const ers::Core::BOOLEAN_NAMES[] = {
"false",
"true" } ;
13const char*
const ers::Core::RESPONSIBILITY_NAMES[] = {
"precondition",
"internal",
"subSystem" } ;
23 const unsigned int index = (
unsigned int)
s ;
25 return ers::Core::SEVERITY_NAMES[index] ;
46 return parse_severity(
s.c_str());
55 const unsigned int index = (
unsigned int) r ;
57 return RESPONSIBILITY_NAMES[index] ;
78 return parse_responsibility(
s.c_str()) ;
91 if (strcasecmp(
s,BOOLEAN_NAMES[1])==0)
return 1 ;
92 if (strcasecmp(
s,BOOLEAN_NAMES[0])==0)
return 0 ;
102 int index =
b ? 1 : 0 ;
103 return BOOLEAN_NAMES[index] ;
117 while(isdigit(**ptr)) {
122 std::string
s(*ptr,l);
137 const char *ptr = name ;
138 std::ostringstream stream ;
145 stream << parse_prefix_string(&ptr) <<
"::" ;
147 stream << parse_prefix_string(&ptr);
152 std::vector<std::string> result_vector ;
153 std::string::size_type start_p, end_p ;
154 start_p = text.find_first_not_of(separators) ;
155 while(start_p != std::string::npos) {
156 end_p = text.find_first_of(separators,start_p) ;
157 if (end_p == std::string::npos) {
158 end_p = text.length();
160 const std::string sub_str = text.substr(start_p,end_p-start_p);
161 result_vector.push_back(sub_str) ;
162 start_p = text.find_first_not_of(separators,end_p) ;
164 return result_vector ;
static int parse_boolean(const char *s)
string to boolean
static std::string parse_prefix_string(const char **ptr)
prefix string data to string
static std::string umangle_gcc_class_name(const char *name)
unmangles gcc RTTI names
static responsibility_t parse_responsibility(const char *s)
string to responsibility
static std::vector< std::string > tokenize(const std::string &text, const std::string &separators)
static const char * to_string(severity_t s)
severity_t to string
static severity_t parse_severity(const char *s)
string to severity_t
static const std::string empty_string
enum ers::_responsibility_t responsibility_t
enum ers::_severity_t severity_t