Index: src/ch/FileInfo.cpp =================================================================== diff -u -r044d0e17cdedf3055202486a2235e1a3c8dd6e56 -rca1933ef07e18d939449e4878eca5cc81cc73f3f --- src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision 044d0e17cdedf3055202486a2235e1a3c8dd6e56) +++ src/ch/FileInfo.cpp (.../FileInfo.cpp) (revision ca1933ef07e18d939449e4878eca5cc81cc73f3f) @@ -114,7 +114,7 @@ m_strDstPath = strPath; } -CString CClipboardEntry::GetDestinationPath() +CString CClipboardEntry::GetDestinationPath() const { return m_strDstPath; } @@ -483,7 +483,7 @@ && rInfo.m_ftLastWrite.dwHighDateTime == m_ftLastWrite.dwHighDateTime && rInfo.m_ftLastWrite.dwLowDateTime == m_ftLastWrite.dwLowDateTime && rInfo.m_uhFileSize == m_uhFileSize); } -CString CFileInfo::GetDestinationPath(CString strPath, int iFlags) +CString CFileInfo::GetDestinationPath(CString strPath, int iFlags) const { // add '\\' if (strPath.Right(1) != _T("\\")) @@ -540,7 +540,7 @@ return strPath; } -int CFileInfo::GetBufferIndex(const CDestPath& dpDestPath) +int CFileInfo::GetBufferIndex(const CDestPath& dpDestPath) const { if(m_stSrcIndex != std::numeric_limits::max()) return m_pClipboard->GetAt(m_stSrcIndex)->GetBufferIndex(dpDestPath); @@ -550,7 +550,7 @@ /////////////////////////////////////////////////////////////////////// // Array -CFileInfoArray::CFileInfoArray(CClipboardArray& rClipboardArray) : +CFileInfoArray::CFileInfoArray(const CClipboardArray& rClipboardArray) : m_rClipboard(rClipboardArray) { } @@ -613,14 +613,14 @@ return ullSize; } -int CFileInfoArray::GetBufferIndexAt(size_t stIndex, const CDestPath& rDestPath) +int CFileInfoArray::GetBufferIndexAt(size_t stIndex, const CDestPath& rDestPath) const { boost::shared_lock lock(m_lock); if(stIndex >= m_vFiles.size()) return 0; else { - CFileInfoPtr& spFileInfo = m_vFiles[stIndex]; + const CFileInfoPtr& spFileInfo = m_vFiles[stIndex]; if(!spFileInfo) THROW(_T("Invalid pointer"), 0, 0, 0); Index: src/ch/FileInfo.h =================================================================== diff -u -r044d0e17cdedf3055202486a2235e1a3c8dd6e56 -rca1933ef07e18d939449e4878eca5cc81cc73f3f --- src/ch/FileInfo.h (.../FileInfo.h) (revision 044d0e17cdedf3055202486a2235e1a3c8dd6e56) +++ src/ch/FileInfo.h (.../FileInfo.h) (revision ca1933ef07e18d939449e4878eca5cc81cc73f3f) @@ -47,7 +47,7 @@ CString GetFileName() const; void SetMove(bool bValue) { m_bMove=bValue; } - bool GetMove() { return m_bMove; } + bool GetMove() const { return m_bMove; } int GetDriveNumber(); @@ -66,7 +66,7 @@ } void SetDestinationPath(const CString& strPath); - CString GetDestinationPath(); + CString GetDestinationPath() const; bool IsDestinationPathSet() const { return !m_strDstPath.IsEmpty(); } private: @@ -180,7 +180,7 @@ CString GetFileRoot() const; /** @cmember returns C:\WINDOWS\ for C:\WINDOWS\WIN.INI */ CString GetFileName() const; /** @cmember returns WIN.INI for C:\WINDOWS\WIN.INI */ - const CString& GetFilePath(void) const { return m_strFilePath; } // returns path with m_strFilePath (probably not full) + const CString& GetFilePath() const { return m_strFilePath; } // returns path with m_strFilePath (probably not full) CString GetFullFilePath() const; /** @cmember returns C:\WINDOWS\WIN.INI for C:\WINDOWS\WIN.INI */ void SetFilePath(LPCTSTR lpszPath) { m_strFilePath=lpszPath; }; @@ -204,15 +204,15 @@ void SetFlags(uint_t uiFlags, uint_t uiMask = 0xffffffff) { m_uiFlags = (m_uiFlags & ~(uiFlags & uiMask)) | (uiFlags & uiMask); } // operations - void SetClipboard(CClipboardArray *pClipboard) { m_pClipboard=pClipboard; }; - CString GetDestinationPath(CString strPath, int iFlags); + void SetClipboard(const CClipboardArray *pClipboard) { m_pClipboard = pClipboard; }; + CString GetDestinationPath(CString strPath, int iFlags) const; void SetSrcIndex(size_t stIndex) { m_stSrcIndex = stIndex; }; size_t GetSrcIndex() const { return m_stSrcIndex; }; - bool GetMove() { if (m_stSrcIndex != std::numeric_limits::max()) return m_pClipboard->GetAt(m_stSrcIndex)->GetMove(); else return true; }; + bool GetMove() const { if (m_stSrcIndex != std::numeric_limits::max()) return m_pClipboard->GetAt(m_stSrcIndex)->GetMove(); else return true; }; - int GetBufferIndex(const CDestPath& dpDestPath); + int GetBufferIndex(const CDestPath& dpDestPath) const; // operators bool operator==(const CFileInfo& rInfo); @@ -246,15 +246,15 @@ uint_t m_uiFlags; // ptrs to elements providing data - CClipboardArray* m_pClipboard; + const CClipboardArray* m_pClipboard; }; typedef boost::shared_ptr CFileInfoPtr; class CFileInfoArray { public: - CFileInfoArray(CClipboardArray& rClipboardArray); + CFileInfoArray(const CClipboardArray& rClipboardArray); ~CFileInfoArray(); // Adds a new object info to this container @@ -280,28 +280,28 @@ unsigned long long CalculateTotalSize(); /// Retrieves buffer index for an item at a specified index - int GetBufferIndexAt(size_t stIndex, const CDestPath& rDestPath); + int GetBufferIndexAt(size_t stIndex, const CDestPath& rDestPath) const; /// Stores infos about elements in the archive template - void Store(Archive& ar, unsigned int /*uiVersion*/, bool bOnlyFlags); + void Store(Archive& ar, unsigned int /*uiVersion*/, bool bOnlyFlags) const; /// Restores info from the archive template void Load(Archive& ar, unsigned int /*uiVersion*/, bool bOnlyFlags); protected: - CClipboardArray& m_rClipboard; + const CClipboardArray& m_rClipboard; std::vector m_vFiles; mutable boost::shared_mutex m_lock; }; template -void CFileInfoArray::Store(Archive& ar, unsigned int /*uiVersion*/, bool bOnlyFlags) +void CFileInfoArray::Store(Archive& ar, unsigned int /*uiVersion*/, bool bOnlyFlags) const { size_t stCount = m_vFiles.size(); ar << stCount; - for(std::vector::iterator iterFile = m_vFiles.begin(); iterFile != m_vFiles.end(); ++iterFile) + for(std::vector::const_iterator iterFile = m_vFiles.begin(); iterFile != m_vFiles.end(); ++iterFile) { if(bOnlyFlags) { Index: src/ch/TTaskDefinition.cpp =================================================================== diff -u -r044d0e17cdedf3055202486a2235e1a3c8dd6e56 -rca1933ef07e18d939449e4878eca5cc81cc73f3f --- src/ch/TTaskDefinition.cpp (.../TTaskDefinition.cpp) (revision 044d0e17cdedf3055202486a2235e1a3c8dd6e56) +++ src/ch/TTaskDefinition.cpp (.../TTaskDefinition.cpp) (revision ca1933ef07e18d939449e4878eca5cc81cc73f3f) @@ -73,7 +73,7 @@ m_arrSourcePaths.RemoveAll(); } -CClipboardArray& TTaskDefinition::GetSourcePaths() +const CClipboardArray& TTaskDefinition::GetSourcePaths() const { return m_arrSourcePaths; } Index: src/ch/TTaskDefinition.h =================================================================== diff -u -r044d0e17cdedf3055202486a2235e1a3c8dd6e56 -rca1933ef07e18d939449e4878eca5cc81cc73f3f --- src/ch/TTaskDefinition.h (.../TTaskDefinition.h) (revision 044d0e17cdedf3055202486a2235e1a3c8dd6e56) +++ src/ch/TTaskDefinition.h (.../TTaskDefinition.h) (revision ca1933ef07e18d939449e4878eca5cc81cc73f3f) @@ -41,7 +41,7 @@ CClipboardEntryPtr GetSourcePathAt(size_t stIndex) const; size_t GetSourcePathCount() const; void ClearSourcePaths(); - CClipboardArray& GetSourcePaths(); + const CClipboardArray& GetSourcePaths() const; void SetDestinationPath(const CString& strPath); CString GetDestinationPath() const;