📄 processbib.cpp
字号:
#include "processbib.h"
char ExecPath[256];
int UpperPath(char* Path)
{
char *a,*b,*c;
if (!*Path)
return 0;
c = Path;
a = strrchr(c,'\\');
b = strrchr(c,'/');
if (a<b)
a=b;
if (!a)
{
a=c;
if (!a[0]) // only mime left
a=c=Path;
}
else
++a;
if (a==c)
*a = 0;
while (--a>=c && (*a=='\\' || *a=='/'))
*a = 0;
return 1;
}
void GetCurrentDirectory(char* Path)
{
GetModuleFileName(NULL, Path, 255);
UpperPath(Path);
return ;
}
void AbsPath(char* Abs,char* Any, char* Base)
{
if((Abs == NULL)&&(Base == NULL))
{
return;
}
else
{
strcpy(Abs,Base);
strcat(Abs,"\\");
strcat(Abs,Any);
}
}
int main(int argc ,void *argv[])
{
CxIOFile *infile,*outfile;
char str[512];
int strlen=1;
int i=0;
unsigned int readlen=0;
char inpath[256],outpath[256];
GetCurrentDirectory(ExecPath);
AbsPath(outpath,"ce.bib", ExecPath);
AbsPath(inpath,"ce_orig.bib",ExecPath);
MoveFile(outpath,inpath);
infile = new CxIOFile(NULL);
outfile = new CxIOFile(NULL);
infile->Open(inpath,"rb");
outfile->Open(outpath,"w+b");
Sleep(100);
while(strlen)
{
memset(str,0,sizeof(str));
strlen=infile->GetStr(str,sizeof(str));
outfile->parsestr(str,strlen);
outfile->PutStr(str);
readlen+=strlen;
if(readlen>=infile->Size())
break;
}
delete infile;
delete outfile;
Sleep(1000);
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -