*sqlite engine wrapper changed
[sqool.git] / include / core / stdoutput.h
blob396be98e5d26d76d41222a754ef6d087be238dc3
1 // License: GPL 2 - se the COPYING file in the root directory
3 /*!
4 The class manages the standard output things.
5 @author Marek Malevic
6 @brief Stdout wrapper
7 @class classStdoutput
8 @date 2006
9 */
11 #ifndef H_STDOUTPUT
12 #define H_STDOUTPUT
14 /*!
15 @enum VER_MODE Defines the verbosity steps.
17 typedef enum {
18 /* no output */
19 V_MODE_MUTE = 0,
20 /* errors */
21 V_MODE_ERRORS = 1,
22 /* + warnings */
23 V_MODE_WARNINGS = 2,
24 /* + advices */
25 V_MODE_ADVICE = 3,
26 /* + info */
27 V_MODE_INFO = 4
28 } VER_MODE ;
31 #define V_DEFAULT_MODE V_MODE_INFO
33 #define STRING_ADVICE "ADVICE:"
34 #define STRING_ERROR "ERROR:"
35 #define STRING_INFO ""
36 #define STRING_WARNING "WARNING:"
38 #include <iostream>
40 class classStdoutput{
41 public:
42 /*!
43 creates the stdoutput object
44 @param v_mode the verbosity mode
45 @sa ~classStdoutput()
47 classStdoutput(VER_MODE v_mode = V_DEFAULT_MODE);
49 /*!
50 destroys the db engine object
51 @sa classStdoutput(VER_MODE v_mode = V_DEFAULT_MODE)
53 ~classStdoutput();
55 /*!
56 sends a message to std::cout if the verbosity mode is at least V_MODE_ADVICE
57 @param s_message message to send
58 @sa classStdoutput(VER_MODE v_mode = V_DEFAULT_MODE),
59 Error(std::string s_message, int erro_code = 0),
60 Warning(std::string s_message),
61 Info(std::string s_message)
62 */
63 void Advice(std::string s_message, bool show_msgbox = 0);
65 /*!
66 sends a message to std::cerr if the verbosity mode is at least V_MODE_ERROR
67 @param s_message message to send
68 @param erro_code error number
69 @sa classStdoutput(VER_MODE v_mode = V_DEFAULT_MODE),
70 Warning(std::string s_message),
71 Advice(std::string s_message),
72 Info(std::string s_message)
74 void Error(std::string s_message, bool show_msgbox = 0);
76 /*!
77 sends a message to std::cout if the verbosity mode is at least V_MODE_INFO
78 @param s_message message to send
79 @sa classStdoutput(VER_MODE v_mode = V_DEFAULT_MODE),
80 Error(std::string s_message, int erro_code = 0),
81 Warning(std::string s_message),
82 Advice(std::string s_message),
84 void Info(std::string s_message, bool show_msgbox = 0);
86 /*!
87 sends a message to std::clog if the verbosity mode is at least V_MODE_WARNING
88 @param s_message message to send
89 @sa classStdoutput(VER_MODE v_mode = V_DEFAULT_MODE),
90 Error(std::string s_message, int erro_code = 0),
91 Advice(std::string s_message),
92 Info(std::string s_message)
94 void Warning(std::string s_message, bool show_msgbox = 0);
96 private:
97 unsigned int verbosity_mode;
101 #endif