/***************************************************************************************** Construction *****************************************************************************************/ CAPEInfo::CAPEInfo(int * pErrorCode, const wchar_t * pFilename, CAPETag * pTag) { *pErrorCode = ERROR_SUCCESS; CloseFile(); // open the file m_spIO.Assign(new IO_CLASS_NAME); if (m_spIO->Open(pFilename) != 0) { CloseFile(); *pErrorCode = ERROR_INVALID_INPUT_FILE; return; } // get the file information if (GetFileInformation(TRUE) != 0) { CloseFile(); *pErrorCode = ERROR_INVALID_INPUT_FILE; return; } // get the tag (do this second so that we don't do it on failure) if (pTag == NULL) { // we don't want to analyze right away for non-local files // since a single I/O object is shared, we can't tag and read at the same time (i.e. in multiple threads) BOOL bAnalyzeNow = TRUE; if ((_wcsnicmp(pFilename, L"http://", 7) == 0) || (_wcsnicmp(pFilename, L"m01p://", 7) == 0)) bAnalyzeNow = FALSE; m_spAPETag.Assign(new CAPETag(m_spIO, bAnalyzeNow)); } else { m_spAPETag.Assign(pTag); } // update CheckHeaderInformation(); }
CAPEInfo::CAPEInfo(int * pErrorCode, CIO * pIO, CAPETag * pTag) { *pErrorCode = ERROR_SUCCESS; CloseFile(); m_spIO.Assign(pIO, FALSE, FALSE); // get the file information if (GetFileInformation(TRUE) != 0) { CloseFile(); *pErrorCode = ERROR_INVALID_INPUT_FILE; return; } // get the tag (do this second so that we don't do it on failure) if (pTag == NULL) m_spAPETag.Assign(new CAPETag(m_spIO, TRUE)); else m_spAPETag.Assign(pTag); }