CC Localization
utils.hh
Go to the documentation of this file.
1 
5 #pragma once
6 #include <string>
7 
9 extern std::string esc_str(
10  std::string const & s
11 );
12 
14 struct Error
15 {
16  std::string msg;
17  Error(std::string const & msg
19  ) : msg(msg) {}
20 };
21 
22 extern int msg_level;
23 extern std::ostream & msg(int level);
24 extern std::ostream & debug;
25 extern std::ostream & info;
26 extern std::ostream & warn;
27 void error(std::string const & m);
void error(std::string const &m)
throw error after error message
Definition: utils.cc:58
std::string esc_str(std::string const &s)
escape a string in a way that when double quoted, recovers original
Definition: utils.cc:9
int msg_level
level below which messages are shown
Definition: utils.cc:46
Error(std::string const &msg)
Create exception with message.
Definition: utils.hh:18
Error exception.
Definition: utils.hh:14
std::string msg
Definition: utils.hh:16
std::ostream & info
ostream informative message
Definition: utils.cc:54
std::ostream & debug
ostream for debugging message
Definition: utils.cc:53
std::ostream & warn
ostream warning message
Definition: utils.cc:55