CC Localization
Classes | Functions | Variables
utils.hh File Reference

Miscellaneous utilities. More...

#include <string>
Include dependency graph for utils.hh:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  Error
 Error exception. More...
 

Functions

std::string esc_str (std::string const &s)
 escape a string in a way that when double quoted, recovers original More...
 
std::ostream & msg (int level)
 message stream with given level More...
 
void error (std::string const &m)
 throw error after error message More...
 

Variables

int msg_level
 level below which messages are shown More...
 
std::ostream & debug
 ostream for debugging message More...
 
std::ostream & info
 ostream informative message More...
 
std::ostream & warn
 ostream warning message More...
 

Detailed Description

Miscellaneous utilities.

Author
Chun-Chung Chen <cjj@u.nosp@m..was.nosp@m.hingt.nosp@m.on.e.nosp@m.du>

Definition in file utils.hh.

Function Documentation

◆ error()

void error ( std::string const &  m)

throw error after error message

throw error after error message

Definition at line 58 of file utils.cc.

◆ esc_str()

std::string esc_str ( std::string const &  s)

escape a string in a way that when double quoted, recovers original

Returns
escaped string

escape a string in a way that when double quoted, recovers original

Parameters
sstring to be escaped

Definition at line 9 of file utils.cc.

◆ msg()

std::ostream& msg ( int  l)

message stream with given level

message stream with given level

Definition at line 48 of file utils.cc.

Variable Documentation

◆ debug

std::ostream& debug

ostream for debugging message

ostream for debugging message

Definition at line 53 of file utils.cc.

◆ info

std::ostream& info

ostream informative message

ostream informative message

Definition at line 54 of file utils.cc.

◆ msg_level

int msg_level

level below which messages are shown

message level to display

Definition at line 46 of file utils.cc.

◆ warn

std::ostream& warn

ostream warning message

ostream warning message

Definition at line 55 of file utils.cc.