forked from YanZhao/hello-world
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileNameTools.h
More file actions
41 lines (30 loc) · 870 Bytes
/
FileNameTools.h
File metadata and controls
41 lines (30 loc) · 870 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
38
39
40
41
/*
参数值:
whole:输入整体字符串, 例如:"c:/system32/abc.txt"
dir: 返回路径名,例如:c:/system32
返回值:
dir路径结果的长度,例如,本例中为11。
*/
int GetDir(char *whole,char* dir);
/*
参数值:
whole:输入整体字符串, 例如:"c:/system32/abc.txt"
name: 返回文件名,例如:abc
返回值:
文件名结果的长度,例如,本例中为3。
*/
int GetName(char *whole,char* name);
/*
参数值:
whole:输入整体字符串, 例如:"c:/system32/abc.txt"
ext: 返回文件名后缀,例如:txt
返回值:
文件名后缀结果的长度,例如,本例中为3。
*/
int GetExt(char *whole,char* ext);
/*
remarks: you input oldFileName="demo.txt", and part="ch".The NewFileName will be "demo-ch.txt".
it will insert string "ch" into the oldFileName between FileName and extension.
*/
void InsertPartToFile(char *oldFileName,char* part,char* NewFileName);
void TestFileNameTools(void);