MCPcopy Index your code
hub / github.com/DreamSourceLab/DSView / CreateNew

Method CreateNew

DSView/pv/ZipMaker.cpp:42–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42bool ZipMaker::CreateNew(const char *fileName, bool bAppend)
43{
44 assert(fileName);
45
46 Release();
47
48 m_zDoc = zipOpen64(fileName, bAppend);
49 if (m_zDoc == NULL) {
50 strcpy(m_error, "zipOpen64 error");
51 }
52
53//make zip inner file time
54 m_zi = new zip_fileinfo();
55
56 time_t rawtime;
57 time (&rawtime);
58 struct tm *tinf= localtime(&rawtime);
59
60 struct tm &ti = *tinf;
61 zip_fileinfo &zi= *(zip_fileinfo*)m_zi;
62
63 zi.tmz_date.tm_year = ti.tm_year;
64 zi.tmz_date.tm_mon = ti.tm_mon;
65 zi.tmz_date.tm_mday = ti.tm_mday;
66 zi.tmz_date.tm_hour = ti.tm_hour;
67 zi.tmz_date.tm_min = ti.tm_min;
68 zi.tmz_date.tm_sec = ti.tm_sec;
69 zi.dosDate = 0;
70
71 return m_zDoc != NULL;
72}
73
74void ZipMaker::Release()
75{

Callers 1

save_startMethod · 0.80

Calls 1

zipOpen64Function · 0.85

Tested by

no test coverage detected