Shiokaze Framework
A research-oriented fluid solver for computer graphics
console Namespace Reference

Namespace that helps executing commands, dumping messages, writing log files. More...

Functions

std::string run (std::string format,...)
 Excecute a command and get result. More...
 
int system (std::string format,...)
 Excecute a command and get result. More...
 
std::string tstr (double msec)
 Convert time duration to string. More...
 
std::string nth (int num)
 Convert enumeration to string such as 1st, 2nd. More...
 
std::string size_str (size_t bytes)
 Convert byte size to string such as killo bytes and mega bytes. More...
 
std::string format_str (std::string format,...)
 Format string with given arguments. More...
 
void set_root_path (std::string path)
 Set path to export log files. More...
 
std::string get_root_path ()
 Get path to export log files. More...
 
void dump (std::string format,...)
 Print a log message in a single line. More...
 
void set_time (double time)
 Set a time for logging. More...
 
void write (std::string name, double number)
 Export number associated with the name as log file. More...
 

Detailed Description

Namespace that helps executing commands, dumping messages, writing log files.

Function Documentation

◆ dump()

void console::dump ( std::string  format,
  ... 
)

Print a log message in a single line.

Parameters
[in]formatMessage to print.

◆ format_str()

std::string console::format_str ( std::string  format,
  ... 
)

Format string with given arguments.

Parameters
[in]formatformat string.
Returns
Formatted string.

◆ get_root_path()

std::string console::get_root_path ( )

Get path to export log files.

Returns
If set, path to export. Empty string otherwise.

◆ nth()

std::string console::nth ( int  num)

Convert enumeration to string such as 1st, 2nd.

Parameters
[in]numEnumeration in integer.
Returns
Converted string.

◆ run()

std::string console::run ( std::string  format,
  ... 
)

Excecute a command and get result.

Parameters
[in]foramtFormatted command string.
Returns
Result as string.

◆ set_root_path()

void console::set_root_path ( std::string  path)

Set path to export log files.

Parameters
[in]pathPath to export.

◆ set_time()

void console::set_time ( double  time)

Set a time for logging.

Parameters
[in]timeTime to set. Typically in milliseconds.

◆ size_str()

std::string console::size_str ( size_t  bytes)

Convert byte size to string such as killo bytes and mega bytes.

Parameters
[in]bytesByte size.
Returns
Converted string.

◆ system()

int console::system ( std::string  format,
  ... 
)

Excecute a command and get result.

Parameters
[in]foramtFormatted command string.
Returns
Result as integer.

◆ tstr()

std::string console::tstr ( double  msec)

Convert time duration to string.

Parameters
[in]msecTime in milliseconds.
Returns
Converted string.

◆ write()

void console::write ( std::string  name,
double  number 
)

Export number associated with the name as log file.

Parameters
[in]nameName associated with the number.
[in]numberNumber to record.