SHOGUN
v3.2.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) | |
virtual | ~SGIO () |
void | set_loglevel (EMessageType level) |
EMessageType | get_loglevel () const |
bool | loglevel_above (EMessageType type) const |
bool | get_show_progress () const |
EMessageLocation | get_location_info () const |
bool | get_syntax_highlight () const |
void | message (EMessageType prio, const char *function, 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 *function, const char *file, int32_t line) const |
void | deprecated (const char *function, 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 | set_location_info (EMessageLocation location) |
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) |
static char * | c_string_of_substring (substring s) |
static void | print_substring (substring s) |
static float32_t | float_of_substring (substring s) |
static float64_t | double_of_substring (substring s) |
static int32_t | int_of_substring (substring s) |
static uint32_t | ulong_of_substring (substring s) |
static uint32_t | ss_length (substring s) |
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 |
EMessageLocation | location_info |
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 |
char * c_string_of_substring | ( | substring | s | ) | [static] |
char * concat_filename | ( | const char * | filename | ) | [static] |
void deprecated | ( | const char * | function, |
const char * | file, | ||
int32_t | line | ||
) | const |
void disable_progress | ( | ) |
void disable_syntax_highlighting | ( | ) |
void done | ( | ) |
float64_t double_of_substring | ( | substring | s | ) | [static] |
void enable_progress | ( | ) |
void enable_syntax_highlighting | ( | ) |
int filter | ( | CONST_DIRENT_T * | d | ) | [static] |
float32_t float_of_substring | ( | substring | s | ) | [static] |
EMessageLocation get_location_info | ( | ) | const |
EMessageType get_loglevel | ( | ) | const |
const char * get_msg_intro | ( | EMessageType | prio | ) | const [protected] |
bool get_show_progress | ( | ) | const |
bool get_syntax_highlight | ( | ) | const |
FILE* get_target | ( | ) | const |
int32_t int_of_substring | ( | substring | s | ) | [static] |
bool loglevel_above | ( | EMessageType | type | ) | const |
void message | ( | EMessageType | prio, |
const char * | function, | ||
const char * | file, | ||
int32_t | line, | ||
const char * | fmt, | ||
... | |||
) | const |
print a message
optionally prefixed with file name and line number from (use -1 in line to disable this)
prio | message priority |
function | the function name from where the message is called |
file | file name from where the message is called |
line | line number from where the message is called |
fmt | format string |
void not_implemented | ( | const char * | function, |
const char * | file, | ||
int32_t | line | ||
) | const |
void print_substring | ( | substring | s | ) | [static] |
int32_t ref | ( | ) |
int32_t ref_count | ( | ) | const |
static void set_dirname | ( | const char * | dirname | ) | [static] |
void set_location_info | ( | EMessageLocation | location | ) |
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] |
uint32_t ulong_of_substring | ( | substring | s | ) | [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
EMessageLocation location_info [protected] |
EMessageType loglevel [protected] |
const char * message_strings [static, protected] |
const char * message_strings_highlighted [static, protected] |
float64_t progress_start_time [protected] |
bool show_progress [protected] |
bool syntax_highlight [protected] |