-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtools.h
49 lines (39 loc) · 924 Bytes
/
tools.h
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
38
39
40
41
42
43
44
45
46
47
48
49
/*
* tools.h
*
* Created on: 2012-12-8
* Author: zsg
*/
#ifndef TOOLS_H_
#define TOOLS_H_
#include <map>
#include <string>
using namespace std;
typedef std::map<string,string> KEY_VAL_MAP;
/*
*去除字符串右端空格
*/
char *strtrimr(char *pstr);
/*
*去除字符串左端空格
*/
char *strtriml(char *pstr);
/*
*去除字符串两端空格
*/
char *strtrim(char *pstr);
/*
*从配置文件的一行读出key或value,返回item指针
*line--从配置文件读出的一行
*/
int get_item_from_line(char *line, KEY_VAL_MAP *item);
int file_to_items(const char *file, KEY_VAL_MAP *items);
/*
*读取value
*/
int read_conf_value(const char *key, char *value,const char *file);
int write_conf_value(const char *key,char *value,const char *file);
const char* getexedir();
void getMB(float fv, int *intPart, int *fractionalPartToint);
char *getnowdate(char *nowdate);
#endif /* TOOLS_H_ */