Index: src/ch/FileInfo.cpp =================================================================== diff -u -N -re30c2b40bd1b533d8740edc88d80b2fb340f3466 -r1456ff2ae4a98c83f18d20dc253a24f26ddf521d --- src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision e30c2b40bd1b533d8740edc88d80b2fb340f3466) +++ src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision 1456ff2ae4a98c83f18d20dc253a24f26ddf521d) @@ -82,10 +82,37 @@ m_ftLastWrite = ftLastWrite; m_uiFlags = uiFlags; - if(m_pBasePaths && stSrcIndex != std::numeric_limits::max()) - m_pathFile.MakeRelativePath(m_pBasePaths->GetAt(stSrcIndex)); // cut path from clipboard + if(m_pBasePaths && m_stSrcIndex != std::numeric_limits::max()) + m_pathFile.MakeRelativePath(m_pBasePaths->GetAt(m_stSrcIndex)); // cut path from clipboard } +void CFileInfo::Init(const chcore::TSmartPath& rpathFile, DWORD dwAttributes, ULONGLONG uhFileSize, FILETIME ftCreation, FILETIME ftLastAccess, FILETIME ftLastWrite, + uint_t uiFlags) +{ + m_pathFile = rpathFile; + m_stSrcIndex = std::numeric_limits::max(); + m_pBasePaths = NULL; + m_dwAttributes = dwAttributes; + m_uhFileSize = uhFileSize; + m_ftCreation = ftCreation; + m_ftLastAccess = ftLastAccess; + m_ftLastWrite = ftLastWrite; + m_uiFlags = uiFlags; +} + +void CFileInfo::SetParentObject(size_t stIndex, const chcore::TPathContainer* pBasePaths) +{ + // cannot set parent object if there is already one specified + if(m_pBasePaths && m_stSrcIndex != std::numeric_limits::max()) + THROW(_T("Invalid argument"), 0, 0, 0); + + m_stSrcIndex = stIndex; + m_pBasePaths = pBasePaths; + + if(m_pBasePaths && m_stSrcIndex != std::numeric_limits::max()) + m_pathFile.MakeRelativePath(m_pBasePaths->GetAt(m_stSrcIndex)); +} + bool CFileInfo::operator==(const CFileInfo& rInfo) { return (rInfo.m_dwAttributes == m_dwAttributes && rInfo.m_ftCreation.dwHighDateTime == m_ftCreation.dwHighDateTime && rInfo.m_ftCreation.dwLowDateTime == m_ftCreation.dwLowDateTime