CIO Class Reference

List of all members.


Detailed Description

class IO

Definition at line 78 of file io.h.


Public Member Functions

 CIO ()
 CIO (const CIO &orig)
void set_loglevel (EMessageType level)
EMessageType get_loglevel () const
bool get_show_progress () const
void message (EMessageType prio, const char *fmt,...) const
void progress (DREAL current_val, DREAL min_val=0.0, DREAL max_val=1.0, INT decimals=1, const char *prefix="PROGRESS:\t")
void absolute_progress (DREAL current_val, DREAL val, DREAL min_val=0.0, DREAL max_val=1.0, INT decimals=1, const char *prefix="PROGRESS:\t")
void done ()
void not_implemented () 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_dirname (const CHAR *dirname)

Static Public Member Functions

static CHARskip_spaces (CHAR *str)
static CHARskip_blanks (CHAR *str)
static CHARconcat_filename (const CHAR *filename)
static int filter (CONST_DIRENT_T *d)

Protected Member Functions

const CHARget_msg_intro (EMessageType prio) const

Protected Attributes

FILE * target
LONG last_progress_time
LONG progress_start_time
DREAL last_progress
bool show_progress
EMessageType loglevel

Static Protected Attributes

static const EMessageType levels [NUM_LOG_LEVELS] = {M_DEBUG, M_INFO, M_NOTICE, M_WARN, M_ERROR, M_CRITICAL, M_ALERT, M_EMERGENCY, M_MESSAGEONLY}
static const char * message_strings [NUM_LOG_LEVELS] = {"[DEBUG] ", "[INFO] ", "[NOTICE] ", "\033[1;34m[WARN]\033[0m ", "\033[1;31m[ERROR]\033[0m ", "[CRITICAL] ", "[ALERT] ", "[EMERGENCY] ", ""}

Constructor & Destructor Documentation

CIO::CIO (  ) 

default constructor

Definition at line 44 of file io.cpp.

CIO::CIO ( const CIO orig  ) 

copy constructor

Definition at line 49 of file io.cpp.


Member Function Documentation

void CIO::set_loglevel ( EMessageType  level  ) 

set loglevel

Parameters:
level level of log messages

Definition at line 300 of file io.cpp.

EMessageType CIO::get_loglevel (  )  const

get loglevel

Returns:
level of log messages

Definition at line 295 of file io.cpp.

bool CIO::get_show_progress (  )  const

get show_progress

Returns:
if progress bar is shown

Definition at line 305 of file io.cpp.

void CIO::message ( EMessageType  prio,
const char *  fmt,
  ... 
) const

print a message

Parameters:
prio message priority
fmt format string

Definition at line 55 of file io.cpp.

void CIO::progress ( DREAL  current_val,
DREAL  min_val = 0.0,
DREAL  max_val = 1.0,
INT  decimals = 1,
const char *  prefix = "PROGRESS:\t" 
)

print progress bar

Parameters:
current_val current value
min_val minimum value
max_val maximum value
decimals decimals
prefix message prefix

Definition at line 159 of file io.cpp.

void CIO::absolute_progress ( DREAL  current_val,
DREAL  val,
DREAL  min_val = 0.0,
DREAL  max_val = 1.0,
INT  decimals = 1,
const char *  prefix = "PROGRESS:\t" 
)

print absolute progress bar

Parameters:
current_val current value
val value
min_val minimum value
max_val maximum value
decimals decimals
prefix message prefix

Definition at line 209 of file io.cpp.

void CIO::done (  ) 

print 'done' with priority INFO, but only if progress bar is enabled

Definition at line 259 of file io.cpp.

void CIO::not_implemented (  )  const

print error message 'not implemented'

Definition at line 139 of file io.h.

void CIO::buffered_message ( EMessageType  prio,
const CHAR fmt,
  ... 
) const

print a buffered message

Parameters:
prio message priority
fmt format string

Definition at line 146 of file io.cpp.

CHAR * CIO::skip_spaces ( CHAR str  )  [static]

skip leading spaces

Parameters:
str string in which to look for spaces
Returns:
string after after skipping leading spaces

Definition at line 267 of file io.cpp.

CHAR * CIO::skip_blanks ( CHAR str  )  [static]

skip leading spaces + tabs

Parameters:
str string in which to look for blanks
Returns:
string after after skipping leading blanks

Definition at line 281 of file io.cpp.

FILE* CIO::get_target (  )  const

get target

Returns:
file descriptor for target

Definition at line 169 of file io.h.

void CIO::set_target ( FILE *  target  ) 

set target

Parameters:
target file descriptor for target

Definition at line 310 of file io.cpp.

void CIO::set_target_to_stderr (  ) 

set target to stderr

Definition at line 181 of file io.h.

void CIO::set_target_to_stdout (  ) 

set target to stdout

Definition at line 184 of file io.h.

void CIO::enable_progress (  ) 

enable progress bar

Definition at line 187 of file io.h.

void CIO::disable_progress (  ) 

disable progress bar

Definition at line 202 of file io.h.

void CIO::set_dirname ( const CHAR dirname  ) 

set directory name

Parameters:
dirname new directory name

Definition at line 220 of file io.h.

CHAR * CIO::concat_filename ( const CHAR filename  )  [static]

concatenate directory and filename ( non thread safe )

Parameters:
filename new filename
Returns:
concatenated directory and filename

Definition at line 331 of file io.cpp.

int CIO::filter ( CONST_DIRENT_T *  d  )  [static]

filter

Parameters:
d directory entry
Returns:
if filtering was successful

Definition at line 338 of file io.cpp.

const CHAR * CIO::get_msg_intro ( EMessageType  prio  )  const [protected]

get message intro

Parameters:
prio message priority
Returns:
message intro or NULL if message is not to be printed

Definition at line 315 of file io.cpp.


Member Data Documentation

FILE* CIO::target [protected]

target file

Definition at line 251 of file io.h.

last progress time

Definition at line 253 of file io.h.

progress start time

Definition at line 255 of file io.h.

last progress

Definition at line 257 of file io.h.

bool CIO::show_progress [protected]

if progress bar shall be shown

Definition at line 259 of file io.h.

log level

Definition at line 262 of file io.h.

const EMessageType CIO::levels = {M_DEBUG, M_INFO, M_NOTICE, M_WARN, M_ERROR, M_CRITICAL, M_ALERT, M_EMERGENCY, M_MESSAGEONLY} [static, protected]

available log levels

Definition at line 264 of file io.h.

const char * CIO::message_strings = {"[DEBUG] ", "[INFO] ", "[NOTICE] ", "\033[1;34m[WARN]\033[0m ", "\033[1;31m[ERROR]\033[0m ", "[CRITICAL] ", "[ALERT] ", "[EMERGENCY] ", ""} [static, protected]

message strings

Definition at line 266 of file io.h.


The documentation for this class was generated from the following files:

SHOGUN Machine Learning Toolbox - Documentation