MCPcopy Create free account
hub / github.com/Squirrel/Squirrel.Windows / Find

Method Find

src/Setup/unzip.cpp:3923–3944  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3921}
3922
3923ZRESULT TUnzip::Find(const TCHAR *tname,bool ic,int *index,ZIPENTRY *ze)
3924{ char name[MAX_PATH];
3925#ifdef UNICODE
3926 WideCharToMultiByte(CP_UTF8,0,tname,-1,name,MAX_PATH,0,0);
3927#else
3928 strcpy(name,tname);
3929#endif
3930 int res = unzLocateFile(uf,name,ic?CASE_INSENSITIVE:CASE_SENSITIVE);
3931 if (res!=UNZ_OK)
3932 { if (index!=0) *index=-1;
3933 if (ze!=NULL) {ZeroMemory(ze,sizeof(ZIPENTRY)); ze->index=-1;}
3934 return ZR_NOTFOUND;
3935 }
3936 if (currentfile!=-1) unzCloseCurrentFile(uf); currentfile=-1;
3937 int i = (int)uf->num_file;
3938 if (index!=NULL) *index=i;
3939 if (ze!=NULL)
3940 { ZRESULT zres = Get(i,ze);
3941 if (zres!=ZR_OK) return zres;
3942 }
3943 return ZR_OK;
3944}
3945
3946void EnsureDirectory(const TCHAR *rootdir, const TCHAR *dir)
3947{ if (rootdir!=0 && GetFileAttributes(rootdir)==0xFFFFFFFF) CreateDirectory(rootdir,0);

Callers 2

wWinMainFunction · 0.45
FindZipItemFunction · 0.45

Calls 2

unzLocateFileFunction · 0.85
unzCloseCurrentFileFunction · 0.85

Tested by

no test coverage detected