-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetFileName.h
More file actions
23 lines (22 loc) · 748 Bytes
/
getFileName.h
File metadata and controls
23 lines (22 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef FILECONTROL_GETFILENAME
#define FILECONTROL_GETFILENAME
#include "fileControl.h"
mystr c_FileControl::getFileName(const mystr fileName,const int fileIndex=0){
mystr fileNameBase=NULL;
mystr fileNameExtension=NULL;
mystr returnName=NULL;
if(!getNameExt(&fileNameBase,&fileNameExtension,fileName))return NULL;
m_StrF.strAdd(&returnName,fileNameBase);
if(fileIndex>0){
m_StrF.strAdd(&returnName,(mystr)"(",1);
m_StrF.strAdd(&returnName,m_StrF.integer2String(fileIndex));
m_StrF.strAdd(&returnName,(mystr)")",1);
}
if(fileNameExtension!=NULL){
m_StrF.strAdd(&returnName,fileNameExtension);
}
m_StrF.freeStr(&fileNameBase);
m_StrF.freeStr(&fileNameExtension);
return returnName;
};
#endif