-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtool.cpp
More file actions
37 lines (31 loc) · 836 Bytes
/
tool.cpp
File metadata and controls
37 lines (31 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "tool.h"
string TOOL::int2str(int num)
{
stringstream stream;
stream<<num;
return stream.str();
}
string TOOL::getCurrentDate()
{
time_t rawtime;
struct tm *ptminfo;
time(&rawtime);
ptminfo = localtime(&rawtime);
string ss="时间:"+int2str(ptminfo->tm_year+1900)+"年"+int2str(ptminfo->tm_mon+1)+"月"
+int2str(ptminfo->tm_mday)+"日";
return ss;
}
WINDOW *TOOL::create_newwin(int height, int width, int starty, int startx)
{
WINDOW *local_win;
local_win = newwin(height, width, starty, startx);
box(local_win,0,0);
wrefresh(local_win);
return local_win;
}
void TOOL::destory_win(WINDOW *local_win)
{
wborder(local_win, ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ');
wrefresh(local_win);
delwin(local_win);
}