SHOGUN
v1.1.0
|
Class SGIO, used to do input output operations throughout shogun.
Any debug or error or progress message is passed through the functions of this class to be in the end written to the screen. Note that messages don't have to be written to stdout or stderr, but can be redirected to a file.
Public Member Functions | |
SGIO () | |
SGIO (const SGIO &orig) | |
void | set_loglevel (EMessageType level) |
EMessageType | get_loglevel () const |
bool | get_show_progress () const |
bool | get_show_file_and_line () const |
bool | get_syntax_highlight () const |
void | message (EMessageType prio, const char *file, int32_t line, const char *fmt,...) const |
void | progress (float64_t current_val, float64_t min_val=0.0, float64_t max_val=1.0, int32_t decimals=1, const char *prefix="PROGRESS:\t") |
void | absolute_progress (float64_t current_val, float64_t val, float64_t min_val=0.0, float64_t max_val=1.0, int32_t decimals=1, const char *prefix="PROGRESS:\t") |
void | done () |
void | not_implemented (const char *file, int32_t line) const |
void | deprecated (const char *file, int32_t line) const |
void | buffered_message (EMessageType prio, const char *fmt,...) const |
FILE * | get_target () const |
void | set_target (FILE *target) |
void | set_target_to_stderr () |
void | set_target_to_stdout () |
void | enable_progress () |
void | disable_progress () |
void | enable_file_and_line () |
void | disable_file_and_line () |
void | enable_syntax_highlighting () |
void | disable_syntax_highlighting () |
int32_t | ref () |
int32_t | ref_count () const |
int32_t | unref () |
const char * | get_name () |
Static Public Member Functions | |
static char * | skip_spaces (char *str) |
static char * | skip_blanks (char *str) |
static void | set_dirname (const char *dirname) |
static char * | concat_filename (const char *filename) |
static int | filter (CONST_DIRENT_T *d) |
Protected Member Functions | |
const char * | get_msg_intro (EMessageType prio) const |
Protected Attributes | |
FILE * | target |
float64_t | last_progress_time |
float64_t | progress_start_time |
float64_t | last_progress |
bool | show_progress |
bool | show_file_and_line |
bool | syntax_highlight |
EMessageType | loglevel |
Static Protected Attributes | |
static const EMessageType | levels [NUM_LOG_LEVELS] |
static const char * | message_strings_highlighted [NUM_LOG_LEVELS] |
static const char * | message_strings [NUM_LOG_LEVELS] |
static char | file_buffer [FBUFSIZE] |
file name buffer | |
static char | directory_name [FBUFSIZE] |
directory name buffer |
void absolute_progress | ( | float64_t | current_val, |
float64_t | val, | ||
float64_t | min_val = 0.0 , |
||
float64_t | max_val = 1.0 , |
||
int32_t | decimals = 1 , |
||
const char * | prefix = "PROGRESS:\t" |
||
) |
void buffered_message | ( | EMessageType | prio, |
const char * | fmt, | ||
... | |||
) | const |
static char* concat_filename | ( | const char * | filename | ) | [static] |
void deprecated | ( | const char * | file, |
int32_t | line | ||
) | const |
void disable_file_and_line | ( | ) |
void disable_progress | ( | ) |
void disable_syntax_highlighting | ( | ) |
void done | ( | ) |
void enable_file_and_line | ( | ) |
void enable_progress | ( | ) |
void enable_syntax_highlighting | ( | ) |
static int filter | ( | CONST_DIRENT_T * | d | ) | [static] |
EMessageType get_loglevel | ( | ) | const |
const char * get_msg_intro | ( | EMessageType | prio | ) | const [protected] |
bool get_show_file_and_line | ( | ) | const |
bool get_show_progress | ( | ) | const |
bool get_syntax_highlight | ( | ) | const |
FILE* get_target | ( | ) | const |
void message | ( | EMessageType | prio, |
const char * | file, | ||
int32_t | line, | ||
const char * | fmt, | ||
... | |||
) | const |
void not_implemented | ( | const char * | file, |
int32_t | line | ||
) | const |
int32_t ref | ( | ) |
int32_t ref_count | ( | ) | const |
static void set_dirname | ( | const char * | dirname | ) | [static] |
void set_loglevel | ( | EMessageType | level | ) |
void set_target | ( | FILE * | target | ) |
void set_target_to_stderr | ( | ) |
void set_target_to_stdout | ( | ) |
char * skip_blanks | ( | char * | str | ) | [static] |
char * skip_spaces | ( | char * | str | ) | [static] |
int32_t unref | ( | ) |
char directory_name [static, protected] |
char file_buffer [static, protected] |
float64_t last_progress [protected] |
float64_t last_progress_time [protected] |
const EMessageType levels [static, protected] |
{MSG_GCDEBUG, MSG_DEBUG, MSG_INFO, MSG_NOTICE, MSG_WARN, MSG_ERROR, MSG_CRITICAL, MSG_ALERT, MSG_EMERGENCY, MSG_MESSAGEONLY}
available log levels
EMessageType loglevel [protected] |
const char * message_strings [static, protected] |
const char * message_strings_highlighted [static, protected] |
float64_t progress_start_time [protected] |
bool show_file_and_line [protected] |
bool show_progress [protected] |
bool syntax_highlight [protected] |