TRF Language Model
System Tools

Classes

class  wb::File
 file class. More...
 
class  wb::IO_Obj
 base class used to derive. It providing the vritual function of write and read More...
 
class  wb::ObjFile
 used to read more than one objects More...
 
class  wb::ProgressBar
 a progress bar class More...
 
class  wb::Log
 this class can output to the cmd window and log files simultaneously. In wb-log.cpp, there are a Log variable "lout", which can be directly used just like "cout". For example: More...
 
class  wb::Title
 title class - output to the title More...
 
class  wb::Clock
 clock - used to record the time More...
 
class  wb::Path
 Analize the path including "*" and "?" and "+" symbols. More...
 

Macros

#define wbLog_LevelSpace   "\t"
 
#define wbLog_OutputSpace(io)   for (int i=0; i<m_nLevel; i++) io<<wbLog_LevelSpace;
 
#define wbLog_Output(x)
 
#define lout_variable(x)   {wb::lout<<#x" = "<<x<<endl;}
 
#define lout_variable_precent(x, y)   {wb::lout<<#x" = "<<x<<" ("<<100.0*(x)/(y)<<"%) /"#y<<"="<<y<<endl;}
 
#define lout_variable_rate(x, y)   {wb::lout<<100.0*(x)/(y)<<"%("<<x<<"/"<<y<<")";}
 
#define lout_array(x, n)   {wb::lout<<#x"=[ "; for(int i=0; i<n; i++) wb::lout<<x[i]<<" "; wb::lout<<"]"<<endl; }
 
#define lout_error(x)   {wb::lout.bOutputCmd()=true; wb::lout<<"[ERROR] "<<x<<endl; exit(0);}
 
#define lout_warning(x)   {wb::lout<<"[WARNING] "<<x<<endl;}
 
#define lout_assert(p)   {if(!(p)) lout_error("! ("#p")"); }
 
#define precent(x, n)   (x)<<"("<<100.0*(x)/(n)<<"%)"
 
#define MAX_PATH_LEN   256
 

Functions

void wb::Pause ()
 pause More...
 
void wb::outPrecent (long long n, bool bNew=false, long long nTotal=100, const char *title="Process")
 print precent in the cmd window More...
 
void wb::outPrecent (ifstream &ifile, bool bNew=false, const char *title="Process")
 print precent in the cmd window More...
 
void wb::outPrecent (FILE *fp, bool bNew=false, const char *title="Process")
 print precent in the cmd window More...
 
template<typename T >
Logwb::Log::output (T *pArray, int n, const char *pgap=" ")
 output an array More...
 

Variables

Log wb::lout
 the defination is in wb-log.cpp More...
 
const int wb::cn_title_max_len = 500
 

Detailed Description

This is the module of tools for system, which includes:
command line parameter parsing
file management
log reading/writing
...

Macro Definition Documentation

§ lout_array

#define lout_array (   x,
 
)    {wb::lout<<#x"=[ "; for(int i=0; i<n; i++) wb::lout<<x[i]<<" "; wb::lout<<"]"<<endl; }

Definition at line 182 of file wb-log.h.

§ lout_assert

#define lout_assert (   p)    {if(!(p)) lout_error("! ("#p")"); }

Definition at line 185 of file wb-log.h.

§ lout_error

#define lout_error (   x)    {wb::lout.bOutputCmd()=true; wb::lout<<"[ERROR] "<<x<<endl; exit(0);}

Definition at line 183 of file wb-log.h.

§ lout_variable

#define lout_variable (   x)    {wb::lout<<#x" = "<<x<<endl;}

Definition at line 179 of file wb-log.h.

§ lout_variable_precent

#define lout_variable_precent (   x,
 
)    {wb::lout<<#x" = "<<x<<" ("<<100.0*(x)/(y)<<"%) /"#y<<"="<<y<<endl;}

Definition at line 180 of file wb-log.h.

§ lout_variable_rate

#define lout_variable_rate (   x,
 
)    {wb::lout<<100.0*(x)/(y)<<"%("<<x<<"/"<<y<<")";}

Definition at line 181 of file wb-log.h.

§ lout_warning

#define lout_warning (   x)    {wb::lout<<"[WARNING] "<<x<<endl;}

Definition at line 184 of file wb-log.h.

§ MAX_PATH_LEN

#define MAX_PATH_LEN   256

Definition at line 127 of file wb-win.h.

§ precent

#define precent (   x,
 
)    (x)<<"("<<100.0*(x)/(n)<<"%)"

Definition at line 187 of file wb-log.h.

§ wbLog_LevelSpace

#define wbLog_LevelSpace   "\t"

Definition at line 54 of file wb-log.h.

§ wbLog_Output

#define wbLog_Output (   x)
Value:
if (m_bOutputLog) { {wbLog_OutputSpace(m_fileLog)} m_fileLog<<x; } \
if (m_bOutputCmd) { {wbLog_OutputSpace(cout)} cout<<x; }\
return *this;
#define wbLog_OutputSpace(io)
Definition: wb-log.h:56

Definition at line 58 of file wb-log.h.

§ wbLog_OutputSpace

#define wbLog_OutputSpace (   io)    for (int i=0; i<m_nLevel; i++) io<<wbLog_LevelSpace;

Definition at line 56 of file wb-log.h.

Function Documentation

§ outPrecent() [1/3]

void wb::outPrecent ( long long  n,
bool  bNew,
long long  nTotal,
const char *  title 
)

print precent in the cmd window

Definition at line 251 of file wb-win.cpp.

§ outPrecent() [2/3]

void wb::outPrecent ( ifstream &  ifile,
bool  bNew,
const char *  title 
)

print precent in the cmd window

Definition at line 294 of file wb-win.cpp.

§ outPrecent() [3/3]

void wb::outPrecent ( FILE *  fp,
bool  bNew,
const char *  title 
)

print precent in the cmd window

Definition at line 308 of file wb-win.cpp.

§ output()

template<typename T >
Log & wb::Log::output ( T *  pArray,
int  n,
const char *  pgap = " " 
)

output an array

Definition at line 170 of file wb-log.h.

§ Pause()

void wb::Pause ( )

pause

Definition at line 246 of file wb-win.cpp.

Variable Documentation

§ cn_title_max_len

const int wb::cn_title_max_len = 500

Definition at line 58 of file wb-win.h.

§ lout

Log wb::lout

the defination is in wb-log.cpp

Definition at line 22 of file wb-log.cpp.