OSDN Git Service

Constify some methods
authorsdottaka <sdottaka@sourceforge.net>
Thu, 2 Oct 2014 16:29:51 +0000 (01:29 +0900)
committersdottaka <sdottaka@sourceforge.net>
Thu, 2 Oct 2014 16:29:51 +0000 (01:29 +0900)
--HG--
branch : stable

48 files changed:
Src/Common/LanguageSelect.cpp
Src/Common/LanguageSelect.h
Src/Common/MDITabBar.cpp
Src/Common/MDITabBar.h
Src/Common/RegOptionsMgr.cpp
Src/Common/RegOptionsMgr.h
Src/CompareEngines/ByteCompare.cpp
Src/CompareEngines/ByteCompare.h
Src/CompareEngines/DiffUtils.cpp
Src/CompareEngines/DiffUtils.h
Src/CompareEngines/TimeSizeCompare.cpp
Src/CompareEngines/TimeSizeCompare.h
Src/CompareOptions.cpp
Src/CompareOptions.h
Src/CompareStats.cpp
Src/CompareStats.h
Src/ConfigLog.cpp
Src/ConfigLog.h
Src/DiffWrapper.cpp
Src/DiffWrapper.h
Src/DirDoc.cpp
Src/DirDoc.h
Src/DirView.cpp
Src/DirView.h
Src/FileFilterHelper.cpp
Src/FileFilterHelper.h
Src/FileVersion.cpp
Src/FileVersion.h
Src/FilterList.cpp
Src/FilterList.h
Src/HexMergeDoc.cpp
Src/HexMergeDoc.h
Src/MainFrm.cpp
Src/MainFrm.h
Src/Merge.cpp
Src/Merge.h
Src/MergeDoc.cpp
Src/MergeDoc.h
Src/MergeEditView.cpp
Src/MergeEditView.h
Src/MovedLines.cpp
Src/MovedLines.h
Src/Plugins.cpp
Src/Plugins.h
Src/VSSHelper.cpp
Src/VSSHelper.h
Src/markdown.cpp
Src/markdown.h

index 65e2777..c53fd15 100644 (file)
@@ -846,7 +846,7 @@ BOOL CLanguageSelect::SetLanguage(LANGID wLangId)
  * @param [in] wLangId Language ID.
  * @return Language filename, or empty string if no file for language found.
  */
-String CLanguageSelect::GetFileName(LANGID wLangId)
+String CLanguageSelect::GetFileName(LANGID wLangId) const
 {
        String filename;
        String path = env_GetProgPath().append(szRelativePath);
@@ -1161,7 +1161,7 @@ void CLanguageSelect::ReloadMenu()
 }
 
 
-UINT CLanguageSelect::GetDocResId()
+UINT CLanguageSelect::GetDocResId() const
 {
        if (((CMDIFrameWnd*)AfxGetApp()->m_pMainWnd)->MDIGetActive())
                return m_idDocMenu;
index 3712815..67e1efd 100644 (file)
@@ -30,7 +30,7 @@ public:
        void SetModuleHandle(HMODULE hModule) { m_hModule = hModule; }
        CLanguageSelect(UINT idMainMenu, UINT idDocMenu, BOOL bReloadMenu =TRUE, BOOL bUpdateTitle =TRUE, CWnd* pParent = NULL);   // standard constructor
        BOOL AreLangsInstalled() const;
-       WORD GetLangId() { return m_wCurLanguage; };
+       WORD GetLangId() const { return m_wCurLanguage; }
        void InitializeLanguage();
        void UpdateDocTitle();
        void ReloadMenu();
@@ -57,10 +57,10 @@ private:
        unsigned m_codepage;
 // Implementation methods
 private:
-       String GetFileName(LANGID);
+       String GetFileName(LANGID) const;
        BOOL LoadLanguageFile(LANGID);
        BOOL SetLanguage(LANGID);
-       UINT GetDocResId();
+       UINT GetDocResId() const;
        void LoadAndDisplayLanguages();
 
 // Dialog Data
index 74c1595..a365423 100644 (file)
@@ -402,7 +402,7 @@ void CMDITabBar::OnLButtonUp(UINT nFlags, CPoint point)
        CWnd::OnLButtonUp(nFlags, point);
 }
 
-CRect CMDITabBar::GetCloseButtonRect(int nItem)
+CRect CMDITabBar::GetCloseButtonRect(int nItem) const
 {
        CRect rc;
        GetItemRect(nItem, &rc);
@@ -414,7 +414,7 @@ CRect CMDITabBar::GetCloseButtonRect(int nItem)
        return rc;
 }
 
-int CMDITabBar::GetItemIndexFromPoint(CPoint point)
+int CMDITabBar::GetItemIndexFromPoint(CPoint point) const
 {
        TCHITTESTINFO hit;
        hit.pt = point;
index 834df59..09eb829 100644 (file)
@@ -73,8 +73,8 @@ protected:
        DECLARE_MESSAGE_MAP()
 
 private:
-       CRect GetCloseButtonRect(int nItem);
-       int GetItemIndexFromPoint(CPoint pt);
+       CRect GetCloseButtonRect(int nItem) const;
+       int GetItemIndexFromPoint(CPoint pt) const;
        void SwapTabs(int nIndexA, int nIndexB);
 };
 
index 3674a26..161eb14 100644 (file)
@@ -26,7 +26,7 @@
  * @param [out] strValue Value in registry
  */
 void CRegOptionsMgr::SplitName(const String &strName, String &strPath,
-       String &strValue)
+       String &strValue) const
 {
        size_t pos = strName.rfind('/');
        if (pos != String::npos)
index e27d0ac..2688ffb 100644 (file)
@@ -48,7 +48,7 @@ public:
        virtual int ImportOptions(const String& filename);
 
 protected:
-       void SplitName(const String &strName, String &strPath, String &strValue);
+       void SplitName(const String &strName, String &strPath, String &strValue) const;
        int LoadValueFromReg(HKEY hKey, const String& strName,
                varprop::VariantValue &value);
        int SaveValueToReg(HKEY hKey, const String& strValueName,
index a60dbf4..11b075a 100644 (file)
@@ -302,7 +302,7 @@ static void CopyTextStats(const FileTextStats * stats, FileTextStats * myTextSta
  * @param [in] side For which file to return statistics.
  * @param [out] stats Stats as asked.
  */
-void ByteCompare::GetTextStats(int side, FileTextStats *stats)
+void ByteCompare::GetTextStats(int side, FileTextStats *stats) const
 {
        CopyTextStats(&m_textStats[side], stats);
 }
index b971b98..e0248e7 100644 (file)
@@ -37,7 +37,7 @@ public:
        void SetAbortable(const IAbortable * piAbortable);
        void SetFileData(int items, file_data *data);
        int CompareFiles(FileLocation *location);
-       void GetTextStats(int side, FileTextStats *stats);
+       void GetTextStats(int side, FileTextStats *stats) const;
 
 private:
        boost::scoped_ptr<QuickCompareOptions> m_pOptions; /**< Compare options for diffutils. */
index 70d31ae..e491f9b 100644 (file)
@@ -269,7 +269,7 @@ int DiffUtils::diffutils_compare_files()
  * @param [in] FileNo File to match.
  * return true if any of the expressions matches.
  */
-bool DiffUtils::RegExpFilter(int StartPos, int EndPos, int FileNo)
+bool DiffUtils::RegExpFilter(int StartPos, int EndPos, int FileNo) const
 {
        if (m_pFilterList == NULL)
        {
@@ -312,7 +312,7 @@ bool DiffUtils::RegExpFilter(int StartPos, int EndPos, int FileNo)
  * @return TRUE when compare succeeds, FALSE if error happened during compare.
  */
 bool DiffUtils::Diff2Files(struct change ** diffs, int depth,
-               int * bin_status, bool bMovedBlocks, int * bin_file)
+               int * bin_status, bool bMovedBlocks, int * bin_file) const
 {
        bool bRet = true;
        SE_Handler seh;
@@ -343,7 +343,7 @@ static void CopyTextStats(const file_data * inf, FileTextStats * myTextStats)
  * @param [out] diffs Count of real differences.
  * @param [out] trivialDiffs Count of ignored differences.
  */
-void DiffUtils::GetDiffCounts(int & diffs, int & trivialDiffs)
+void DiffUtils::GetDiffCounts(int & diffs, int & trivialDiffs) const
 {
        diffs = m_ndiffs;
        trivialDiffs = m_ntrivialdiffs;
@@ -354,7 +354,7 @@ void DiffUtils::GetDiffCounts(int & diffs, int & trivialDiffs)
  * @param [in] side For which file to return statistics.
  * @param [out] stats Stats as asked.
  */
-void DiffUtils::GetTextStats(int side, FileTextStats *stats)
+void DiffUtils::GetTextStats(int side, FileTextStats *stats) const
 {
        CopyTextStats(&m_inf[side], stats);
 }
index 96e33a4..5b4a589 100644 (file)
@@ -41,11 +41,11 @@ public:
        void ClearFilterList();
        void SetFileData(int items, file_data *data);
        int diffutils_compare_files();
-       bool RegExpFilter(int StartPos, int EndPos, int FileNo);
-       void GetDiffCounts(int & diffs, int & trivialDiffs);
-       void GetTextStats(int side, FileTextStats *stats);
+       bool RegExpFilter(int StartPos, int EndPos, int FileNo) const;
+       void GetDiffCounts(int & diffs, int & trivialDiffs) const;
+       void GetTextStats(int side, FileTextStats *stats) const;
        bool Diff2Files(struct change ** diffs, int depth,
-                       int * bin_status, bool bMovedBlocks, int * bin_file);
+                       int * bin_status, bool bMovedBlocks, int * bin_file) const;
        void SetCodepage(int codepage) { m_codepage = codepage; }
 
 private:
index db9b12c..ab95f18 100644 (file)
@@ -44,7 +44,7 @@ void TimeSizeCompare::SetAdditionalOptions(bool ignoreSmallDiff)
  * @param [in] di Diffitem info.
  * @return DIFFCODE
  */
-int TimeSizeCompare::CompareFiles(int compMethod, const DIFFITEM &di)
+int TimeSizeCompare::CompareFiles(int compMethod, const DIFFITEM &di) const
 {
        unsigned code = DIFFCODE::SAME;
        if ((compMethod == CMP_DATE) || (compMethod == CMP_DATE_SIZE))
index 6a00aed..3a3c972 100644 (file)
@@ -29,7 +29,7 @@ public:
        TimeSizeCompare();
        ~TimeSizeCompare();
        void SetAdditionalOptions(bool ignoreSmallDiff);
-       int CompareFiles(int compMethod, const DIFFITEM &di);
+       int CompareFiles(int compMethod, const DIFFITEM &di) const;
 
 private:
        bool m_ignoreSmallDiff;
index e3d7f15..05ee894 100644 (file)
@@ -195,7 +195,7 @@ void DiffutilsOptions::SetToDiffUtils()
  * @brief Gets options to DIFFOPTIONS structure.
  * @param [out] options Diffutils options.
  */
-void DiffutilsOptions::GetAsDiffOptions(DIFFOPTIONS &options)
+void DiffutilsOptions::GetAsDiffOptions(DIFFOPTIONS &options) const
 {
        options.bFilterCommentsLines = m_filterCommentsLines;
        options.bIgnoreBlankLines = m_bIgnoreBlankLines;
index 64a1fbf..3f60b7f 100644 (file)
@@ -107,7 +107,7 @@ public:
        DiffutilsOptions(const CompareOptions& options);
        DiffutilsOptions(const DiffutilsOptions& options);
        void SetToDiffUtils();
-       void GetAsDiffOptions(DIFFOPTIONS &options);
+       void GetAsDiffOptions(DIFFOPTIONS &options) const;
        virtual void SetFromDiffOptions(const DIFFOPTIONS & options);
 
        enum DiffOutputType m_outputStyle; /**< Output style (for patch files) */
index acee7c5..5bdf588 100644 (file)
@@ -118,7 +118,7 @@ CompareStats::CMP_STATE CompareStats::GetCompareState() const
  * @param [in] diffcode DIFFITEM.diffcode to convert.
  * @return Compare result.
  */
-CompareStats::RESULT CompareStats::GetResultFromCode(unsigned diffcode)
+CompareStats::RESULT CompareStats::GetResultFromCode(unsigned diffcode) const
 {
        DIFFCODE di = diffcode;
        
index 44e5e27..244e31c 100644 (file)
@@ -80,7 +80,7 @@ public:
        CompareStats::CMP_STATE GetCompareState() const;
        bool IsCompareDone() const { return m_bCompareDone; }
 
-       CompareStats::RESULT GetResultFromCode(unsigned diffcode);
+       CompareStats::RESULT GetResultFromCode(unsigned diffcode) const;
 
 private:
        int m_counts[RESULT_COUNT]; /**< Table storing result counts */
index 3591f13..28f6ba2 100644 (file)
@@ -514,7 +514,7 @@ static String GetNtProductFromRegistry(const OSVERSIONINFOEX & osvi)
  * http://msdn.microsoft.com/en-us/library/ms724833(VS.85).aspx
  * @return String describing Windows version.
  */
-String CConfigLog::GetWindowsVer()
+String CConfigLog::GetWindowsVer() const
 {
        OSVERSIONINFOEX osvi;
        String sVersion;
index 38dcdf5..028e254 100644 (file)
@@ -57,7 +57,7 @@ protected:
 private:
        bool DoFile(String &sError);
        void WritePluginsInLogFile(const wchar_t *transformationEvent);
-       String GetWindowsVer();
+       String GetWindowsVer() const;
        String GetBuildFlags() const;
        void FileWriteString(const String& lpsz);
        void CloseFile();
index 6dbc658..8d48d91 100644 (file)
@@ -159,7 +159,7 @@ void CDiffWrapper::SetCreateDiffList(DiffList *diffList)
  * format used outside CDiffWrapper and returns them.
  * @param [in,out] options Pointer to structure getting used options.
  */
-void CDiffWrapper::GetOptions(DIFFOPTIONS *options)
+void CDiffWrapper::GetOptions(DIFFOPTIONS *options) const
 {
        assert(options);
        DIFFOPTIONS tmpOptions = {0};
@@ -187,7 +187,7 @@ void CDiffWrapper::SetTextForAutomaticPrediff(const String &text)
 {
        m_sToFindPrediffer = text;
 }
-void CDiffWrapper::SetPrediffer(PrediffingInfo * prediffer /*=NULL*/)
+void CDiffWrapper::SetPrediffer(const PrediffingInfo * prediffer /*=NULL*/)
 {
        // all flags are set correctly during the construction
        m_infoPrediffer.reset(new PrediffingInfo);
@@ -195,7 +195,7 @@ void CDiffWrapper::SetPrediffer(PrediffingInfo * prediffer /*=NULL*/)
        if (prediffer)
                *m_infoPrediffer = *prediffer;
 }
-void CDiffWrapper::GetPrediffer(PrediffingInfo * prediffer)
+void CDiffWrapper::GetPrediffer(PrediffingInfo * prediffer) const
 {
        *prediffer = *m_infoPrediffer;
 }
@@ -262,7 +262,7 @@ void CDiffWrapper::SetDetectMovedBlocks(bool bDetectMovedBlocks)
  * @return Returns true if all characters are trivial
  */
 bool CDiffWrapper::IsTrivialBytes(const char* Start, const char* End,
-       const FilterCommentsSet& filtercommentsset)
+       const FilterCommentsSet& filtercommentsset) const
 {
        std::string testdata(Start, End);
        //@TODO: Need to replace the following trivial string with a user specified string
@@ -283,7 +283,7 @@ bool CDiffWrapper::IsTrivialLine(const std::string &Line,
                                   const char * StartOfComment, 
                                   const char * EndOfComment,   
                                   const char * InLineComment,  
-                                  const FilterCommentsSet& filtercommentsset)
+                                  const FilterCommentsSet& filtercommentsset) const
 {
        //Do easy test first
        if ((!StartOfComment || !EndOfComment) && !InLineComment)
@@ -379,7 +379,7 @@ static void ReplaceSpaces(std::string & str, const char *rep)
 */
 bool CDiffWrapper::PostFilter(int StartPos, int EndPos, int Direction,
        int QtyLinesInBlock, OP_TYPE &Op, int FileNo,
-       FilterCommentsSet& filtercommentsset)
+       FilterCommentsSet& filtercommentsset) const
 {
        if (Op == OP_TRIVIAL) //If already set to trivial, then exit.
                return true;
@@ -501,7 +501,7 @@ bool CDiffWrapper::PostFilter(int StartPos, int EndPos, int Direction,
 */
 void CDiffWrapper::PostFilter(int LineNumberLeft, int QtyLinesLeft, int LineNumberRight,
        int QtyLinesRight, OP_TYPE &Op, FilterCommentsManager &filtercommentsmanager,
-       const String& FileNameExt)
+       const String& FileNameExt) const
 {
        if (Op == OP_TRIVIAL)
                return;
@@ -999,7 +999,7 @@ void CDiffWrapper::FixLastDiffRange(int nFiles, int bufferLines[], bool bMissing
 /**
  * @brief Returns status-data from diff-engine last run
  */
-void CDiffWrapper::GetDiffStatus(DIFFSTATUS *status)
+void CDiffWrapper::GetDiffStatus(DIFFSTATUS *status) const
 {
        std::memcpy(status, &m_status, sizeof(DIFFSTATUS));
 }
@@ -1007,7 +1007,7 @@ void CDiffWrapper::GetDiffStatus(DIFFSTATUS *status)
 /**
  * @brief Formats command-line for diff-engine last run (like it was called from command-line)
  */
-String CDiffWrapper::FormatSwitchString()
+String CDiffWrapper::FormatSwitchString() const
 {
        String switches;
        TCHAR tmpNum[5] = {0};
@@ -1090,7 +1090,7 @@ void CDiffWrapper::SetAppendFiles(bool bAppendFiles)
  * folder compare function is in DiffFileData.cpp.
  */
 bool CDiffWrapper::Diff2Files(struct change ** diffs, DiffFileData *diffData,
-       int * bin_status, int * bin_file)
+       int * bin_status, int * bin_file) const
 {
        bool bRet = true;
        SE_Handler seh;
@@ -1161,7 +1161,7 @@ CDiffWrapper::FreeDiffUtilsScript3(struct change * & script10, struct change * &
  * @param [in] FileNo File to match.
  * return true if any of the expressions matches.
  */
-bool CDiffWrapper::RegExpFilter(int StartPos, int EndPos, int FileNo)
+bool CDiffWrapper::RegExpFilter(int StartPos, int EndPos, int FileNo) const
 {
        if (m_pFilterList == NULL)
        {       
index 7282a57..4acd2e5 100644 (file)
@@ -159,20 +159,20 @@ public:
        void SetCreatePatchFile(const String &filename);
        void SetCreateDiffList(DiffList *diffList);
        void SetDiffList(DiffList *diffList);
-       void GetOptions(DIFFOPTIONS *options);
+       void GetOptions(DIFFOPTIONS *options) const;
        void SetOptions(const DIFFOPTIONS *options);
        void SetTextForAutomaticPrediff(const String &text);
-       void SetPrediffer(PrediffingInfo * prediffer =NULL);
-       void GetPrediffer(PrediffingInfo * prediffer);
+       void SetPrediffer(const PrediffingInfo * prediffer =NULL);
+       void GetPrediffer(PrediffingInfo * prediffer) const;
        void SetPatchOptions(const PATCHOPTIONS *options);
        void SetDetectMovedBlocks(bool bDetectMovedBlocks);
-       bool GetDetectMovedBlocks() { return (m_pMovedLines[0] != NULL); }
+       bool GetDetectMovedBlocks() const { return (m_pMovedLines[0] != NULL); }
        void SetAppendFiles(bool bAppendFiles);
        void SetPaths(const PathContext &files, bool tempPaths);
        void SetAlternativePaths(const PathContext &altPaths);
        void SetCodepage(int codepage) { m_codepage = codepage; }
        bool RunFileDiff();
-       void GetDiffStatus(DIFFSTATUS *status);
+       void GetDiffStatus(DIFFSTATUS *status) const;
        void AddDiffRange(DiffList *pDiffList, unsigned begin0, unsigned end0, unsigned begin1, unsigned end1, OP_TYPE op);
        void AddDiffRange(DiffList *pDiffList, DIFFRANGE &dr);
        void FixLastDiffRange(int nFiles, int bufferLines[], bool bMissingNL[], bool bIgnoreBlankLines);
@@ -183,21 +183,21 @@ public:
        void SetFilterList(const String& filterStr);
        void EnablePlugins(bool enable);
        bool IsTrivialBytes(const char* Start, const char* End,
-               const FilterCommentsSet& filtercommentsset);
+               const FilterCommentsSet& filtercommentsset) const;
        bool IsTrivialLine(const std::string &Line, const char * StartOfComment,
           const char * EndOfComment, const char * InLineComment,
-          const FilterCommentsSet& filtercommentsset);
+          const FilterCommentsSet& filtercommentsset) const;
        bool PostFilter(int StartPos, int EndPos, int Direction,
                int QtyLinesInBlock, OP_TYPE &Op, int FileNo,
-               FilterCommentsSet& filtercommentsset);
+               FilterCommentsSet& filtercommentsset) const;
        void PostFilter(int LineNumberLeft, int QtyLinesLeft, int LineNumberRight,
                int QtyLinesRight, OP_TYPE &Op, FilterCommentsManager &filtercommentsmanager,
-               const String& FileNameExt);
+               const String& FileNameExt) const;
 
 protected:
-       String FormatSwitchString();
+       String FormatSwitchString() const;
        bool Diff2Files(struct change ** diffs, DiffFileData *diffData,
-               int * bin_status, int * bin_file);
+               int * bin_status, int * bin_file) const;
        void LoadWinMergeDiffsFromDiffUtilsScript(struct change * script, const file_data * inf);
        void WritePatchFile(struct change * script, file_data * inf);
 public:
@@ -205,7 +205,7 @@ public:
                struct change * script10, struct change * script12,
                const file_data * inf10, const file_data * inf12);
        void FreeDiffUtilsScript3(struct change * & script10, struct change * & script12);
-       bool RegExpFilter(int StartPos, int EndPos, int FileNo);
+       bool RegExpFilter(int StartPos, int EndPos, int FileNo) const;
 
 private:
        DiffutilsOptions m_options;
index bfe2da0..c0f31b7 100644 (file)
@@ -395,7 +395,7 @@ void CDirDoc::Rescan()
  * @return TRUE if item should be shown, FALSE if not.
  * @sa CDirDoc::Redisplay()
  */
-bool CDirDoc::IsShowable(const DIFFITEM & di)
+bool CDirDoc::IsShowable(const DIFFITEM & di) const
 {
        if (di.customFlags1 & ViewCustomFlags::HIDDEN)
                return FALSE;
@@ -490,7 +490,7 @@ void CDirDoc::Redisplay()
        m_pDirView->Redisplay();
 }
 
-CDirView * CDirDoc::GetMainView()
+CDirView * CDirDoc::GetMainView() const
 {
        CDirView *pView = NULL;
        if (POSITION pos = GetFirstViewPosition())
@@ -1174,7 +1174,7 @@ void CDirDoc::SetItemViewFlag(UINT flag, UINT mask)
  * @brief Checks if current folders are opened from archive file.
  * @return true if we are inside archive, false otherwise.
  */
-bool CDirDoc::IsArchiveFolders()
+bool CDirDoc::IsArchiveFolders() const
 {
        if (m_pTempPathContext)
                return true;
index 7f82d87..09d7d0f 100644 (file)
@@ -70,7 +70,7 @@ public:
 // Operations
 public:
        BOOL CloseMergeDocs();
-       CDirView * GetMainView();
+       CDirView * GetMainView() const;
        CMergeDoc * GetMergeDocForDiff(int nFiles, BOOL * pNew);
        CHexMergeDoc * GetHexMergeDocForDiff(int nFiles, BOOL * pNew);
        BOOL ReusingDirDoc();
@@ -127,7 +127,7 @@ public:
        void SetPluginPrediffer(const String& filteredFilenames, const String & prediffer);
        void FetchPluginInfos(const String& filteredFilenames, 
                              PackingInfo ** infoUnpacker, PrediffingInfo ** infoPrediffer);
-       bool IsShowable(const DIFFITEM & di);
+       bool IsShowable(const DIFFITEM & di) const;
 
        bool HasDiffs() const { return m_pCtxt != NULL; }
        const CDiffContext & GetDiffContext() const { return *m_pCtxt; }
@@ -152,7 +152,7 @@ public:
        void SetItemViewFlag(Poco::UIntPtr key, UINT flag, UINT mask);
        void SetItemViewFlag(UINT flag, UINT mask);
        const CompareStats * GetCompareStats() const { return m_pCompareStats.get(); };
-       bool IsArchiveFolders();
+       bool IsArchiveFolders() const;
 
 protected:
        void LoadLineFilterList();
index 4e95b47..dafdf33 100644 (file)
@@ -4210,7 +4210,7 @@ void CDirView::OnHelp()
 /**
  * @brief true while user is editing a file name.
  */
-bool CDirView::IsLabelEdit()
+bool CDirView::IsLabelEdit() const
 {
        return (NULL != m_pList->GetEditControl());
 }
@@ -4218,7 +4218,7 @@ bool CDirView::IsLabelEdit()
 /**
  * @brief true if selected item is a "special item".
  */
-bool CDirView::IsItemSelectedSpecial()
+bool CDirView::IsItemSelectedSpecial() const
 {
        int nSelItem = m_pList->GetNextItem(-1, LVNI_SELECTED);
        ASSERT(-1 != nSelItem);
@@ -4394,7 +4394,7 @@ void CDirView::OnBnClickedComparisonStop()
 /**
  * @brief Populate colors for items in view, depending on difference status
  */
-void CDirView::GetColors (int nRow, int nCol, COLORREF& clrBk, COLORREF& clrText)
+void CDirView::GetColors (int nRow, int nCol, COLORREF& clrBk, COLORREF& clrText) const
 {
        const DIFFITEM& di = GetDiffItem (nRow);
 
index 0ffb7df..052d786 100644 (file)
@@ -482,11 +482,11 @@ private:
        CShellContextMenu* GetCorrespondingShellContextMenu(HMENU hMenu) const;
        void ReloadColumns();
        void ResetColumnWidths();
-       bool IsLabelEdit();
-       bool IsItemSelectedSpecial();
+       bool IsLabelEdit() const;
+       bool IsItemSelectedSpecial() const;
        void CollapseSubdir(int sel);
        void ExpandSubdir(int sel, bool bRecursive = false);
-       void GetColors(int nRow, int nCol, COLORREF& clrBk, COLORREF& clrText);
+       void GetColors(int nRow, int nCol, COLORREF& clrBk, COLORREF& clrText) const;
        DirViewTreeState *SaveTreeState();
        void RestoreTreeState(DirViewTreeState *pTreeState);
        void PrepareDragData(String& filesForDroping);
index eabaefb..cd801ce 100644 (file)
@@ -212,7 +212,7 @@ void FileFilterHelper::SetMask(const String& strMask)
  * @param [in] szFileName Filename to test.
  * @return true unless we're suppressing this file by filter
  */
-bool FileFilterHelper::includeFile(const String& szFileName)
+bool FileFilterHelper::includeFile(const String& szFileName) const
 {
        if (m_bUseMask)
        {
@@ -245,7 +245,7 @@ bool FileFilterHelper::includeFile(const String& szFileName)
  * @param [in] szFileName Directoryname to test.
  * @return true unless we're suppressing this directory by filter
  */
-bool FileFilterHelper::includeDir(const String& szDirName)
+bool FileFilterHelper::includeDir(const String& szDirName) const
 {
        if (m_bUseMask)
        {
index 6c3c612..70fd958 100644 (file)
@@ -59,9 +59,9 @@ struct FileFilterInfo
 class IDiffFilter
 {
 public:
-       virtual bool includeFile(const String& szFileName) = 0;
-       virtual bool includeDir(const String& szDirName) = 0;
-       bool includeFile(const String& szFileName1, const String& szFileName2)
+       virtual bool includeFile(const String& szFileName) const = 0;
+       virtual bool includeDir(const String& szDirName) const = 0;
+       bool includeFile(const String& szFileName1, const String& szFileName2) const
        {
                if (!szFileName1.empty())
                        return includeFile(szFileName1);
@@ -70,7 +70,7 @@ public:
                else
                        return false;
        }
-       bool includeFile(const String& szFileName1, const String& szFileName2, const String& szFileName3)
+       bool includeFile(const String& szFileName1, const String& szFileName2, const String& szFileName3) const
        {
                if (!szFileName1.empty())
                        return includeFile(szFileName1);
@@ -81,7 +81,7 @@ public:
                else
                        return false;
        }
-       bool includeDir(const String& szDirName1, const String& szDirName2)
+       bool includeDir(const String& szDirName1, const String& szDirName2) const
        {
                if (!szDirName1.empty())
                        return includeDir(szDirName1);
@@ -90,7 +90,7 @@ public:
                else
                        return false;
        }
-       bool includeDir(const String& szDirName1, const String& szDirName2, const String& szDirName3)
+       bool includeDir(const String& szDirName1, const String& szDirName2, const String& szDirName3) const
        {
                if (!szDirName1.empty())
                        return includeDir(szDirName1);
@@ -147,8 +147,8 @@ public:
        String GetFilterNameOrMask() const;
        bool SetFilter(const String &filter);
 
-       bool includeFile(const String& szFileName);
-       bool includeDir(const String& szDirName);
+       bool includeFile(const String& szFileName) const;
+       bool includeDir(const String& szDirName) const;
 
 protected:
        String ParseExtensions(const String &extensions) const;
index 19a07f7..7fe12bd 100644 (file)
@@ -47,7 +47,7 @@ void FileVersion::SetFileVersion(unsigned versionMS, unsigned versionLS)
  * @return File version number as a string. Returns empty string if there is
  * no version number for the file.
  */
-String FileVersion::GetFileVersionString()
+String FileVersion::GetFileVersionString() const
 {
        if (m_fileVersionMS == 0xffffffff && m_fileVersionLS >= 0xfffffffe)
                return _T("");
index 336095c..2a2d079 100644 (file)
@@ -28,7 +28,7 @@ public:
        bool IsCleared() const { return m_fileVersionMS == 0xffffffff && m_fileVersionLS == 0xffffffff; };
        void SetFileVersion(unsigned versionMS, unsigned versionLS);
        void SetFileVersionNone() { m_fileVersionMS = 0xffffffff; m_fileVersionLS = 0xfffffffe; };
-       String GetFileVersionString();
+       String GetFileVersionString() const;
 };
 
 #endif // _FILE_VERSION_H_
index dce227f..d5ea8cf 100644 (file)
@@ -60,7 +60,7 @@ void FilterList::RemoveAllFilters()
  * @brief Returns if list has any expressions.
  * @return true if list contains one or more expressions.
  */
-bool FilterList::HasRegExps()
+bool FilterList::HasRegExps() const
 {
        return !m_list.empty();
 }
@@ -120,7 +120,7 @@ bool FilterList::Match(const std::string& string, int codepage/*=CP_UTF8*/)
  * This function returns the regular expression string that matched last.
  * @return Last matched expression, or NULL in case no matches yet.
  */
-const char * FilterList::GetLastMatchExpression()
+const char * FilterList::GetLastMatchExpression() const
 {
        return m_lastMatchExpression->c_str();
 }
index b766249..56f24cc 100644 (file)
@@ -45,9 +45,9 @@ public:
        
        void AddRegExp(const std::string& regularExpression);
        void RemoveAllFilters();
-       bool HasRegExps();
+       bool HasRegExps() const;
        bool Match(const std::string& string, int codepage = CP_UTF8);
-       const char * GetLastMatchExpression();
+       const char * GetLastMatchExpression() const;
 
 private:
        std::vector <filter_item_ptr> m_list;
index 6aabe30..fbef78d 100644 (file)
@@ -533,7 +533,7 @@ HRESULT CHexMergeDoc::LoadOneFile(int index, LPCTSTR filename, BOOL readOnly)
 /**
  * @brief Load files and initialize frame's compare result icon
  */
-HRESULT CHexMergeDoc::OpenDocs(const PathContext &paths, bool bRO[])
+HRESULT CHexMergeDoc::OpenDocs(const PathContext &paths, const bool bRO[])
 {
        CHexMergeFrame *pf = GetParentFrame();
        ASSERT(pf);
index 20135d3..09ba42c 100644 (file)
@@ -82,7 +82,7 @@ public:
        BOOL CloseNow();
        CHexMergeFrame * GetParentFrame() const;
        void UpdateHeaderPath(int pane);
-       HRESULT OpenDocs(const PathContext &paths, bool bRO[]);
+       HRESULT OpenDocs(const PathContext &paths, const bool bRO[]);
        void CheckFileChanged(void);
 private:
        static void CopySel(CHexMergeView *pViewSrc, CHexMergeView *pViewDst);
index 3dadc17..fb74957 100644 (file)
@@ -638,7 +638,7 @@ FileLocationGuessEncodings(FileLocation & fileloc, int iGuessEncoding)
 
 int CMainFrame::ShowAutoMergeDoc(CDirDoc * pDirDoc,
        int nFiles, const FileLocation ifileloc[],
-       DWORD dwFlags[] /*=0*/, PackingInfo * infoUnpacker /*= NULL*/)
+       const DWORD dwFlags[] /*=0*/, const PackingInfo * infoUnpacker /*= NULL*/)
 {
        int pane;
        FileFilterHelper filter;
@@ -665,7 +665,7 @@ int CMainFrame::ShowAutoMergeDoc(CDirDoc * pDirDoc,
  */
 int CMainFrame::ShowMergeDoc(CDirDoc * pDirDoc,
        int nFiles, const FileLocation ifileloc[],
-       DWORD dwFlags[] /*=0*/, PackingInfo * infoUnpacker /*= NULL*/)
+       const DWORD dwFlags[] /*=0*/, const PackingInfo * infoUnpacker /*= NULL*/)
 {
        BOOL docNull;
        if (!m_pMenus[MENU_MERGEVIEW])
@@ -772,7 +772,7 @@ int CMainFrame::ShowMergeDoc(CDirDoc * pDirDoc,
 }
 
 void CMainFrame::ShowHexMergeDoc(CDirDoc * pDirDoc, 
-       const PathContext &paths, bool bRO[])
+       const PathContext &paths, const bool bRO[])
 {
        BOOL docNull;
        if (!m_pMenus[MENU_HEXMERGEVIEW])
@@ -782,7 +782,7 @@ void CMainFrame::ShowHexMergeDoc(CDirDoc * pDirDoc,
 }
 
 int CMainFrame::ShowImgMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[],
-               DWORD dwFlags[], PackingInfo * infoUnpacker/* = NULL*/)
+               const DWORD dwFlags[], const PackingInfo * infoUnpacker/* = NULL*/)
 {
        CImgMergeFrame *pImgMergeFrame = new CImgMergeFrame();
        if (!CImgMergeFrame::menu.m_hMenu)
@@ -1019,9 +1019,9 @@ static bool AddToRecentDocs(const PathContext& paths, const unsigned flags[], bo
  * @param [in] prediffer Prediffer plugin name.
  * @return TRUE if opening files and compare succeeded, FALSE otherwise.
  */
-BOOL CMainFrame::DoFileOpen(PathContext * pFiles /*=NULL*/,
-       DWORD dwFlags[] /*=0*/, bool bRecurse /*=FALSE*/, CDirDoc *pDirDoc/*=NULL*/,
-       String prediffer /*=_T("")*/, PackingInfo *infoUnpacker/*=NULL*/)
+BOOL CMainFrame::DoFileOpen(const PathContext * pFiles /*=NULL*/,
+       const DWORD dwFlags[] /*=0*/, bool bRecurse /*=FALSE*/, CDirDoc *pDirDoc/*=NULL*/,
+       String prediffer /*=_T("")*/, const PackingInfo *infoUnpacker/*=NULL*/)
 {
        if (pDirDoc && !pDirDoc->CloseMergeDocs())
                return FALSE;
index b1b01ac..795f6b5 100644 (file)
@@ -102,16 +102,16 @@ public:
        HMENU GetPrediffersSubmenu(HMENU mainMenu);
        void UpdatePrediffersMenu();
 
-       BOOL DoFileOpen(PathContext *pFiles = NULL,
-               DWORD dwFlags[] = NULL, bool bRecurse = false, CDirDoc *pDirDoc = NULL, String prediffer = _T(""), PackingInfo * infoUnpacker = NULL);
+       BOOL DoFileOpen(const PathContext *pFiles = NULL,
+               const DWORD dwFlags[] = NULL, bool bRecurse = false, CDirDoc *pDirDoc = NULL, String prediffer = _T(""), const PackingInfo * infoUnpacker = NULL);
        int ShowAutoMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[],
-               DWORD dwFlags[], PackingInfo * infoUnpacker = NULL);
+               const DWORD dwFlags[], const PackingInfo * infoUnpacker = NULL);
        int ShowMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[],
-               DWORD dwFlags[], PackingInfo * infoUnpacker = NULL);
+               const DWORD dwFlags[], const PackingInfo * infoUnpacker = NULL);
        void ShowHexMergeDoc(CDirDoc * pDirDoc,
-               const PathContext &paths, bool bRO[]);
+               const PathContext &paths, const bool bRO[]);
        int ShowImgMergeDoc(CDirDoc * pDirDoc, int nFiles, const FileLocation fileloc[],
-               DWORD dwFlags[], PackingInfo * infoUnpacker = NULL);
+               const DWORD dwFlags[], const PackingInfo * infoUnpacker = NULL);
 
        void UpdateResources();
        CString SetStatus(LPCTSTR status);
index 46ae7d9..f6c6846 100644 (file)
@@ -1360,7 +1360,7 @@ void CMergeApp::ReloadMenu()
  * @brief Get default editor path.
  * @return full path to the editor program executable.
  */
-String CMergeApp::GetDefaultEditor()
+String CMergeApp::GetDefaultEditor() const
 {
        String path = env_GetWindowsDirectory();
        path += _T("\\NOTEPAD.EXE");
@@ -1377,7 +1377,7 @@ String CMergeApp::GetDefaultEditor()
  *  not exist.
  * @return Default folder for user filters.
  */
-String CMergeApp::GetDefaultFilterUserPath(BOOL bCreate /*=FALSE*/)
+String CMergeApp::GetDefaultFilterUserPath(BOOL bCreate /*=FALSE*/) const
 {
        String pathMyFolders = env_GetMyDocuments();
        String pathFilters(pathMyFolders);
index 31ad679..4d90d44 100644 (file)
@@ -130,8 +130,8 @@ public:
        void AddToRecentProjectsMRU(LPCTSTR sPathName);
        void SetNeedIdleTimer();
        void SetLastCompareResult(int nResult) { m_nLastCompareResult = nResult; }
-       String GetDefaultEditor();
-       String GetDefaultFilterUserPath(BOOL bCreate = FALSE);
+       String GetDefaultEditor() const;
+       String GetDefaultFilterUserPath(BOOL bCreate = FALSE) const;
 
        COptionsMgr * GetMergeOptionsMgr() { return static_cast<COptionsMgr *> (m_pOptions.get()); }
        FileFilterHelper * GetGlobalFileFilter() { return m_pGlobalFileFilter.get(); }
index 91a77b2..ebb9507 100644 (file)
@@ -315,7 +315,7 @@ CMergeEditView * CMergeDoc::GetActiveMergeView()
        return pMergeEditView;
 }
 
-void CMergeDoc::SetUnpacker(PackingInfo * infoNewHandler)
+void CMergeDoc::SetUnpacker(const PackingInfo * infoNewHandler)
 {
        if (infoNewHandler)
        {
@@ -323,7 +323,7 @@ void CMergeDoc::SetUnpacker(PackingInfo * infoNewHandler)
        }
 }
 
-void CMergeDoc::SetPrediffer(PrediffingInfo * infoPrediffer)
+void CMergeDoc::SetPrediffer(const PrediffingInfo * infoPrediffer)
 {
        m_diffWrapper.SetPrediffer(infoPrediffer);
 }
@@ -3171,7 +3171,7 @@ void CMergeDoc::OnFileRecompareAsBinary()
 
 // Return file extension either from file name or file description (if WinMerge is used as an
 // external Rational ClearCase tool.
-String CMergeDoc::GetFileExt(LPCTSTR sFileName, LPCTSTR sDescription)
+String CMergeDoc::GetFileExt(LPCTSTR sFileName, LPCTSTR sDescription) const
 {
        String sExt;
        paths_SplitFilename(sFileName, NULL, NULL, &sExt);
index a291572..c3b1aba 100644 (file)
@@ -221,8 +221,8 @@ public:
        void SetEditedAfterRescan(int nBuffer);
        bool IsEditedAfterRescan(int nBuffer) { return m_bEditAfterRescan[nBuffer]; }
 
-       void SetUnpacker(PackingInfo * infoUnpacker);
-       void SetPrediffer(PrediffingInfo * infoPrediffer);
+       void SetUnpacker(const PackingInfo * infoUnpacker);
+       void SetPrediffer(const PrediffingInfo * infoPrediffer);
        void GetPrediffer(PrediffingInfo * infoPrediffer);
        void SetMergeViews(CMergeEditView * pView[]);
        void SetMergeDetailViews(CMergeEditView * pView[]);
@@ -276,7 +276,7 @@ public:
        std::vector<CMergeEditView*>::iterator curUndo;
        void FlushAndRescan(bool bForced = false);
        void SetCurrentDiff(int nDiff);
-       int GetCurrentDiff() { return m_nCurDiff; }
+       int GetCurrentDiff() const { return m_nCurDiff; }
        virtual ~CMergeDoc();
        virtual void OnFileEvent (WPARAM wEvent, LPCTSTR pszPathName);
        void SetDetectMovedBlocks(bool bDetectMovedBlocks);
@@ -369,7 +369,7 @@ private:
        void AdjustDiffBlock(DiffMap & diffmap, const DIFFRANGE & diffrange, int lo0, int hi0, int lo1, int hi1);
        int GetMatchCost(const String &Line0, const String &Line1);
        void FlagMovedLines();
-       String GetFileExt(LPCTSTR sFileName, LPCTSTR sDescription);
+       String GetFileExt(LPCTSTR sFileName, LPCTSTR sDescription) const;
        void DoFileSave(int pane);
 };
 
index 4532a18..1c31ed6 100644 (file)
@@ -1579,7 +1579,7 @@ void CMergeEditView::SelectNone()
  * @sa CMergeDoc::GetCurrentDiff()
  * @sa CMergeDoc::LineInDiff()
  */
-bool CMergeEditView::IsLineInCurrentDiff(int nLine)
+bool CMergeEditView::IsLineInCurrentDiff(int nLine) const
 {
        // Check validity of nLine
 #ifdef _DEBUG
@@ -1590,7 +1590,7 @@ bool CMergeEditView::IsLineInCurrentDiff(int nLine)
                _RPTF2(_CRT_ERROR, "Linenumber > linecount (%d>%d)!", nLine, nLineCount);
 #endif
 
-       CMergeDoc *pd = GetDocument();
+       const CMergeDoc *pd = GetDocument();
        int curDiff = pd->GetCurrentDiff();
        if (curDiff == -1)
                return false;
@@ -2153,7 +2153,7 @@ void CMergeEditView::OnTimer(UINT_PTR nIDEvent)
  * @brief Returns if buffer is read-only
  * @note This has no any relation to file being read-only!
  */
-bool CMergeEditView::IsReadOnly(int pane)
+bool CMergeEditView::IsReadOnly(int pane) const
 {
        return GetDocument()->m_ptBuf[pane]->GetReadOnly() != false;
 }
@@ -3647,7 +3647,7 @@ bool CMergeEditView::IsCursorInDiff() const
 */
 bool CMergeEditView::IsDiffVisible(int nDiff)
 {
-       CMergeDoc *pd = GetDocument();
+       const CMergeDoc *pd = GetDocument();
 
        DIFFRANGE diff;
        pd->m_diffList.GetDiff(nDiff, diff);
index 7bf0b11..7766c25 100644 (file)
@@ -116,11 +116,11 @@ private:
 public:
        void RefreshOptions();
        bool EnableRescan(bool bEnable);
-       bool IsReadOnly(int pane);
+       bool IsReadOnly(int pane) const;
        void ShowDiff(bool bScroll, bool bSelectText);
        virtual void OnEditOperation(int nAction, LPCTSTR pszText, int cchText);
        void UpdateLineLengths();
-       bool IsLineInCurrentDiff(int nLine);
+       bool IsLineInCurrentDiff(int nLine) const;
        void SelectNone();
        void SelectDiff(int nDiff, bool bScroll = true, bool bSelectText = true);
        virtual CCrystalTextBuffer *LocateTextBuffer ();
@@ -144,9 +144,9 @@ public:
                , COLORREF & crBkgnd, COLORREF & crText, bool & bDrawWhitespace);
        void WMGoto() { OnWMGoto(); };
        void GotoLine(UINT nLine, bool bRealLine, int pane);
-       int GetTopLine() { return m_nTopLine; }
+       int GetTopLine() const { return m_nTopLine; }
        int GetScreenLines() { return CCrystalTextView::GetScreenLines(); }
-       int GetTopSubLine() { return m_nTopSubLine; }
+       int GetTopSubLine() const { return m_nTopSubLine; }
        int GetSubLines(int nLineIndex) { return CCrystalTextView::GetSubLines(nLineIndex); }
        virtual int GetSubLineCount() { return CCrystalTextView::GetSubLineCount(); }
        virtual int GetSubLineIndex(int nLineIndex) { return CCrystalTextView::GetSubLineIndex(nLineIndex); }
index ba45e69..875bfba 100644 (file)
@@ -37,7 +37,7 @@ void MovedLines::Add(ML_SIDE side1, unsigned line1,   unsigned line2)
  * @param [in] line Linenumber to check.
  * @param [in] side Side of the linenumber.
  */
-int MovedLines::LineInBlock(unsigned line, ML_SIDE side)
+int MovedLines::LineInBlock(unsigned line, ML_SIDE side) const
 {
        if (side == SIDE_LEFT)
                return SecondSideInMovedBlock(line);
@@ -48,7 +48,7 @@ int MovedLines::LineInBlock(unsigned line, ML_SIDE side)
 /**
  * @brief Get right->left info for a moved line (real line number)
  */
-int MovedLines::FirstSideInMovedBlock(unsigned secondSideLine)
+int MovedLines::FirstSideInMovedBlock(unsigned secondSideLine) const
 {
        MovedLinesMap::const_iterator iter;
        iter = m_moved1.find(secondSideLine);
@@ -61,7 +61,7 @@ int MovedLines::FirstSideInMovedBlock(unsigned secondSideLine)
 /**
  * @brief Get left->right info for a moved line (real line number)
  */
-int MovedLines::SecondSideInMovedBlock(unsigned firstSideLine)
+int MovedLines::SecondSideInMovedBlock(unsigned firstSideLine) const
 {
        MovedLinesMap::const_iterator iter;
        iter = m_moved0.find(firstSideLine);
index 2c20cb7..42ff842 100644 (file)
@@ -26,11 +26,11 @@ public:
 
        void Clear();
        void Add(ML_SIDE side1, unsigned line1, unsigned line2);
-       int LineInBlock(unsigned line, ML_SIDE side);
+       int LineInBlock(unsigned line, ML_SIDE side) const;
 
 protected:
-       int FirstSideInMovedBlock(unsigned secondSideLine);
-       int SecondSideInMovedBlock(unsigned firstSideLine);
+       int FirstSideInMovedBlock(unsigned secondSideLine) const;
+       int SecondSideInMovedBlock(unsigned firstSideLine) const;
 
 private:
        typedef std::map<int, int> MovedLinesMap;
index ad5cb3c..e332764 100644 (file)
@@ -287,7 +287,7 @@ void PluginInfo::LoadFilterString()
 }
 
 
-bool PluginInfo::TestAgainstRegList(const String& szTest)
+bool PluginInfo::TestAgainstRegList(const String& szTest) const
 {
        if (m_filters.empty() || szTest.empty())
                return false;
index 6666d09..9e0c61d 100644 (file)
@@ -66,7 +66,7 @@ public:
         *
         * @param szTest String of filenames, delimited with '|'
         */
-       bool TestAgainstRegList(const String& szTest);
+       bool TestAgainstRegList(const String& szTest) const;
 
 public:
        String      m_filepath;
index cccfe0c..cd0618e 100644 (file)
@@ -33,7 +33,7 @@
 #include "MergeApp.h"
 #include "resource.h"
 
-String VSSHelper::GetProjectBase()
+String VSSHelper::GetProjectBase() const
 {
        return m_strVssProjectBase;
 }
@@ -229,7 +229,7 @@ void VSSHelper::GetFullVSSPath(const String& strSavePath, bool & bVCProj)
  * @param [in] charset pointer to string containing delimiter chars
  */
 bool VSSHelper::GetWordFromFile(HANDLE pfile, TCHAR * buffer,
-               DWORD dwBufferSize, TCHAR * charset)
+               DWORD dwBufferSize, TCHAR * charset) const
 {
        TCHAR buf[1024] = {0};
        const DWORD bytesToRead = sizeof(buf);
@@ -249,7 +249,7 @@ bool VSSHelper::GetWordFromFile(HANDLE pfile, TCHAR * buffer,
 }
 
 int VSSHelper::GetWordFromBuffer(TCHAR *inBuffer, DWORD dwInBufferSize,
-               TCHAR * outBuffer, DWORD dwOutBufferSize, TCHAR * charset)
+               TCHAR * outBuffer, DWORD dwOutBufferSize, TCHAR * charset) const
 {
        TCHAR ctemp = '\0';
        TCHAR * pcharset = NULL;
@@ -330,7 +330,7 @@ int VSSHelper::GetWordFromBuffer(TCHAR *inBuffer, DWORD dwInBufferSize,
        return buffercount;
 }
 
-bool VSSHelper::GetVCProjName(HANDLE hFile, HANDLE tFile)
+bool VSSHelper::GetVCProjName(HANDLE hFile, HANDLE tFile) const
 {
        TCHAR buffer[1024] = {0};
        DWORD dwNumWritten = 0;
@@ -367,7 +367,7 @@ bool VSSHelper::GetVCProjName(HANDLE hFile, HANDLE tFile)
        return true;
 }
 
-bool VSSHelper::GetSLNProjUniqueName(HANDLE hFile, HANDLE tFile, TCHAR * buf)
+bool VSSHelper::GetSLNProjUniqueName(HANDLE hFile, HANDLE tFile, TCHAR * buf) const
 {
        TCHAR buffer[1024] = {0};
        DWORD dwNumWritten = 0;
@@ -400,7 +400,7 @@ bool VSSHelper::GetSLNProjUniqueName(HANDLE hFile, HANDLE tFile, TCHAR * buf)
        return true;
 }
 
-bool VSSHelper::GetSLNProjName(HANDLE hFile, HANDLE tFile, TCHAR * buf)
+bool VSSHelper::GetSLNProjName(HANDLE hFile, HANDLE tFile, TCHAR * buf) const
 {
        TCHAR buffer[1024] = {0};
        DWORD dwNumWritten = 0;
index ad51d20..f99c33f 100644 (file)
 class VSSHelper
 {
 public:
-       String GetProjectBase();
+       String GetProjectBase() const;
        bool SetProjectBase(const String& strPath);
 
        bool ReLinkVCProj(const String& strSavePath, String& sError);
        void GetFullVSSPath(const String& strSavePath, bool & bVCProj);
 
 protected:
-       bool GetWordFromFile(HANDLE pfile, TCHAR * buffer, DWORD dwBufferSize, TCHAR * charset = NULL);
+       bool GetWordFromFile(HANDLE pfile, TCHAR * buffer, DWORD dwBufferSize, TCHAR * charset = NULL) const;
        int GetWordFromBuffer(TCHAR * inBuffer, DWORD dwInBufferSize,
-               TCHAR * outBuffer, DWORD dwOutBufferSize, TCHAR * charset = NULL);
-       bool GetVCProjName(HANDLE hFile, HANDLE tFile);
-       bool GetSLNProjUniqueName(HANDLE hFile, HANDLE tFile, TCHAR * buf);
-       bool GetSLNProjName(HANDLE hFile, HANDLE tFile, TCHAR * buf);
+               TCHAR * outBuffer, DWORD dwOutBufferSize, TCHAR * charset = NULL) const;
+       bool GetVCProjName(HANDLE hFile, HANDLE tFile) const;
+       bool GetSLNProjUniqueName(HANDLE hFile, HANDLE tFile, TCHAR * buf) const;
+       bool GetSLNProjName(HANDLE hFile, HANDLE tFile, TCHAR * buf) const;
 
 private:
        String m_strVssProjectBase;
index 83f05d0..8c62c16 100644 (file)
@@ -294,7 +294,7 @@ CMarkdown::operator bool()
        );
 }
 
-int CMarkdown::FindTag(const char *tags, const char *markup)
+int CMarkdown::FindTag(const char *tags, const char *markup) const
 {
        while (int len = strlen(tags))
        {
@@ -507,7 +507,7 @@ bool CMarkdown::Push()
        return false;
 }
 
-std::string CMarkdown::GetTagName()
+std::string CMarkdown::GetTagName() const
 {
        const char *p = first;
        const char *q = first;
@@ -529,7 +529,7 @@ std::string CMarkdown::GetTagName()
        return std::string(p, q - p);
 }
 
-std::string CMarkdown::GetTagText()
+std::string CMarkdown::GetTagText() const
 {
        const char *p = first, *q = first;
        if (q < ahead && (p = ++q) < ahead && (*q != '!' || ++q < ahead))
index 485c605..6b98eda 100644 (file)
@@ -33,15 +33,15 @@ public:
        bool Pull();                                    // pull child nodes into view
        CMarkdown &Pop();                               // irreversible pull for chained calls
        bool Push();                                    // reverse pull
-       std::string GetTagName();               // tag name
-       std::string GetTagText();               // tag name plus attributes
+       std::string GetTagName() const; // tag name
+       std::string GetTagText() const; // tag name plus attributes
        std::string GetInnerText();             // text between enclosing tags
        std::string GetOuterText();             // text including enclosing tags
        std::string GetAttribute(const char *, std::string * = 0); // random or enumerate
 private:
        int (*const memcmp)(const void *, const void *, size_t);
        const char *const utags;
-       int FindTag(const char *, const char *);
+       int FindTag(const char *, const char *) const;
        class Token;
 };