Index: src/ch/DataBuffer.cpp =================================================================== diff -u -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -r6ae1d95bf7dd071fd2b65b8f7aabca1c887bdff8 --- src/ch/DataBuffer.cpp (.../DataBuffer.cpp) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/ch/DataBuffer.cpp (.../DataBuffer.cpp) (revision 6ae1d95bf7dd071fd2b65b8f7aabca1c887bdff8) @@ -32,9 +32,9 @@ && m_uiLANSize == bsSizes.m_uiLANSize); } -void BUFFERSIZES::Serialize(CArchive& ar) +void BUFFERSIZES::Serialize(icpf::archive& ar) { - if (ar.IsStoring()) + if (ar.is_storing()) { ar<(m_bUseMask); - m_astrMask.Serialize(ar); + ar<(m_bUseExcludeMask); - m_astrExcludeMask.Serialize(ar); +// ar<(m_bUseSize); @@ -236,11 +236,11 @@ // files mask ar>>tmp; m_bUseMask=(tmp != 0); - m_astrMask.Serialize(ar); + ar>>m_astrMask; ar>>tmp; m_bUseExcludeMask=(tmp != 0); - m_astrExcludeMask.Serialize(ar); + ar>>m_astrExcludeMask; // size ar>>tmp; @@ -626,9 +626,9 @@ return false; } -void CFiltersArray::Serialize(CArchive& ar) +void CFiltersArray::Serialize(icpf::archive& ar) { - if (ar.IsStoring()) + if (ar.is_storing()) { ar<>m_strFilePath; ar>>m_iSrcIndex; @@ -1015,9 +1015,9 @@ ////////////////////////////////////////////////////////////////////////////// // CClipboardArray -void CClipboardArray::Serialize(CArchive& ar, bool bData) +void CClipboardArray::Serialize(icpf::archive& ar, bool bData) { - if (ar.IsStoring()) + if (ar.is_storing()) { // write data int iSize=GetSize(); @@ -1077,11 +1077,11 @@ m_iBufferIndex=BI_DEFAULT; } -void CClipboardEntry::Serialize(CArchive& ar, bool bData) +void CClipboardEntry::Serialize(icpf::archive& ar, bool bData) { if (bData) { - if (ar.IsStoring()) + if(ar.is_storing()) { ar<(m_bMove); @@ -1101,5 +1101,10 @@ } } else - m_astrDstPaths.Serialize(ar); + { + if(ar.is_storing()) + ar<>m_astrDstPaths; + } } Index: src/ch/FileInfo.h =================================================================== diff -u -rd2b121c78f510b5384b8ef0ca80afbfd7f77fef7 -r6ae1d95bf7dd071fd2b65b8f7aabca1c887bdff8 --- src/ch/FileInfo.h (.../FileInfo.h) (revision d2b121c78f510b5384b8ef0ca80afbfd7f77fef7) +++ src/ch/FileInfo.h (.../FileInfo.h) (revision 6ae1d95bf7dd071fd2b65b8f7aabca1c887bdff8) @@ -90,7 +90,7 @@ CString& GetCombinedExcludeMask(CString& pMask) const; void SetCombinedExcludeMask(const CString& pMask); - void Serialize(CArchive& ar); + void Serialize(icpf::archive& ar); protected: bool MatchMask(LPCTSTR lpszMask, LPCTSTR lpszString) const; @@ -142,7 +142,7 @@ { public: bool Match(const CFileInfo& rInfo) const; - void Serialize(CArchive& ar); + void Serialize(icpf::archive& ar); }; ///////////////////////////////////////////////////////////////////////////// @@ -166,7 +166,7 @@ int GetBufferIndex() const { return m_iBufferIndex; }; - void Serialize(CArchive& ar, bool bData); + void Serialize(icpf::archive& ar, bool bData); private: CString m_strPath; // path (ie. c:\\windows\\) - always with ending '\\' @@ -189,7 +189,7 @@ public: ~CClipboardArray() { RemoveAll(); }; - void Serialize(CArchive& ar, bool bData); + void Serialize(icpf::archive& ar, bool bData); void SetAt(int nIndex, CClipboardEntry* pEntry) { delete [] GetAt(nIndex); SetAt(nIndex, pEntry); }; void RemoveAt(int nIndex, int nCount = 1) { while (nCount--) { delete GetAt(nIndex); static_cast*>(this)->RemoveAt(nIndex, 1); } }; @@ -262,8 +262,8 @@ bool operator==(const CFileInfo& rInfo); // (re)/store data - void Store(CArchive& ar); - void Load(CArchive& ar); + void Store(icpf::archive& ar); + void Load(icpf::archive& ar); private: CString m_strFilePath; // contains relative path (first path is in CClipboardArray) int m_iSrcIndex; // index in CClipboardArray table (which contains the first part of the path) @@ -323,7 +323,7 @@ int AddFile(CString strFilePath, int iSrcIndex); // store/restore - void Store(CArchive& ar, bool bOnlyFlags) + void Store(icpf::archive& ar, bool bOnlyFlags) { INT_PTR iSize = GetSize(); ar << iSize; @@ -337,7 +337,7 @@ } } - void Load(CArchive& ar, bool bOnlyFlags) + void Load(icpf::archive& ar, bool bOnlyFlags) { INT_PTR iSize; ar>>iSize; Index: src/ch/MainWnd.cpp =================================================================== diff -u -r50830b27409540a4b2c97b40cfbf86b78dd02327 -r6ae1d95bf7dd071fd2b65b8f7aabca1c887bdff8 --- src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 50830b27409540a4b2c97b40cfbf86b78dd02327) +++ src/ch/MainWnd.cpp (.../MainWnd.cpp) (revision 6ae1d95bf7dd071fd2b65b8f7aabca1c887bdff8) @@ -1332,7 +1332,7 @@ icpf::config* pConfig = GetConfig(); BOOST_ASSERT(pConfig); if(!pConfig) - return -1; + return 1; while (!pData->bKill) { if (uiCounter == 0 && pConfig->get_bool(PP_PCLIPBOARDMONITORING) && IsClipboardFormatAvailable(CF_HDROP)) @@ -1345,7 +1345,7 @@ pTask=new CTask(&pData->m_pTasks->m_tcd); - for (int i=0;i(handle), i, path, _MAX_PATH); pEntry=new CClipboardEntry; Index: src/ch/Structs.cpp =================================================================== diff -u -r336bb030d9b4bff561ff100563725213ed6703c9 -r6ae1d95bf7dd071fd2b65b8f7aabca1c887bdff8 --- src/ch/Structs.cpp (.../Structs.cpp) (revision 336bb030d9b4bff561ff100563725213ed6703c9) +++ src/ch/Structs.cpp (.../Structs.cpp) (revision 6ae1d95bf7dd071fd2b65b8f7aabca1c887bdff8) @@ -558,7 +558,7 @@ return name; } -void CTask::Load(CArchive& ar, bool bData) +void CTask::Load(icpf::archive& ar, bool bData) { m_cs.Lock(); try @@ -609,7 +609,7 @@ m_bSaved=ucTmp != 0; } } - catch(CException*) + catch(icpf::exception&) { m_cs.Unlock(); throw; @@ -636,8 +636,10 @@ try { - CFile file(lpszDirectory+GetUniqueName()+( (bData) ? _T(".atd") : _T(".atp") ), CFile::modeWrite | CFile::modeCreate); - CArchive ar(&file, CArchive::store); + CString strPath = lpszDirectory+GetUniqueName()+( (bData) ? _T(".atd") : _T(".atp") ); + icpf::archive ar; + ar.open(strPath, FA_WRITE | FA_CREATE | FA_TRUNCATE); + ar.datablock_begin(); if (bData) { @@ -656,7 +658,7 @@ else { ar<(0); ar<<(unsigned char)m_bSaved; } - - ar.Close(); - file.Close(); + ar.datablock_end(); + ar.close(); } - catch(CException* e) + catch(icpf::exception& /*e*/) { - e->Delete(); m_cs.Unlock(); return; } @@ -1381,31 +1381,28 @@ CString strPath=finder.GetFilePath(); // load data file - CFile file(strPath, CFile::modeRead); - CArchive ar(&file, CArchive::load); - + icpf::archive ar; + ar.open(strPath, FA_READ); + ar.datablock_begin(); pTask->Load(ar, true); + ar.datablock_end(); + ar.close(); - ar.Close(); - file.Close(); - // load progress file strPath=strPath.Left(strPath.GetLength()-4); strPath+=_T(".atp"); - CFile file2(strPath, CFile::modeRead); - CArchive ar2(&file2, CArchive::load); - + icpf::archive ar2; + ar2.open(strPath, FA_READ); + ar2.datablock_begin(); pTask->Load(ar2, false); + ar2.datablock_end(); + ar2.close(); - ar2.Close(); - file2.Close(); - // add read task to array Add(pTask); } - catch(CException* e) + catch(icpf::exception&) { - e->Delete(); delete pTask; } } Index: src/ch/Structs.h =================================================================== diff -u -r336bb030d9b4bff561ff100563725213ed6703c9 -r6ae1d95bf7dd071fd2b65b8f7aabca1c887bdff8 --- src/ch/Structs.h (.../Structs.h) (revision 336bb030d9b4bff561ff100563725213ed6703c9) +++ src/ch/Structs.h (.../Structs.h) (revision 6ae1d95bf7dd071fd2b65b8f7aabca1c887bdff8) @@ -211,7 +211,7 @@ // m_strUniqueName CString GetUniqueName(); - void Load(CArchive& ar, bool bData); + void Load(icpf::archive& ar, bool bData); void Store(LPCTSTR lpszDirectory, bool bData); void BeginProcessing();