Shiokaze Framework
A research-oriented fluid solver for computer graphics
console.h
Go to the documentation of this file.
1 /*
2 ** console.h
3 **
4 ** This is part of Shiokaze, a research-oriented fluid solver for computer graphics.
5 ** Created by Ryoichi Ando <rand@nii.ac.jp> on March 16, 2018.
6 **
7 ** Permission is hereby granted, free of charge, to any person obtaining a copy of
8 ** this software and associated documentation files (the "Software"), to deal in
9 ** the Software without restriction, including without limitation the rights to use,
10 ** copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
11 ** Software, and to permit persons to whom the Software is furnished to do so,
12 ** subject to the following conditions:
13 **
14 ** The above copyright notice and this permission notice shall be included in all copies
15 ** or substantial portions of the Software.
16 **
17 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18 ** INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
19 ** PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20 ** HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
21 ** CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
22 ** OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24 //
25 #ifndef SHKZ_CONSOLE_H
26 #define SHKZ_CONSOLE_H
27 //
28 #include <shiokaze/core/common.h>
29 #include <string>
30 //
32 //
34 namespace console {
45  std::string run( std::string format, ...);
54  int system( std::string format, ...);
63  std::string tstr(double msec);
72  std::string nth(int num);
81  std::string size_str( size_t bytes );
90  std::string format_str( std::string format, ...);
97  void set_root_path( std::string path );
104  std::string get_root_path();
111  void dump(std::string format, ...);
118  void set_time( double time );
127  void write( std::string name, double number );
128 }
129 //
131 //
132 #endif
console::dump
void dump(std::string format,...)
Print a log message in a single line.
console::format_str
std::string format_str(std::string format,...)
Format string with given arguments.
console::set_time
void set_time(double time)
Set a time for logging.
console::write
void write(std::string name, double number)
Export number associated with the name as log file.
console::set_root_path
void set_root_path(std::string path)
Set path to export log files.
console::get_root_path
std::string get_root_path()
Get path to export log files.
SHKZ_BEGIN_NAMESPACE
#define SHKZ_BEGIN_NAMESPACE
Name space beggining definition for shiokaze.
Definition: common.h:39
console::size_str
std::string size_str(size_t bytes)
Convert byte size to string such as killo bytes and mega bytes.
console
Namespace that helps executing commands, dumping messages, writing log files.
Definition: console.h:36
console::system
int system(std::string format,...)
Excecute a command and get result.
console::run
std::string run(std::string format,...)
Excecute a command and get result.
console::nth
std::string nth(int num)
Convert enumeration to string such as 1st, 2nd.
common.h
SHKZ_END_NAMESPACE
#define SHKZ_END_NAMESPACE
Name space end definition for shiokaze.
Definition: common.h:44
console::tstr
std::string tstr(double msec)
Convert time duration to string.