From c1775a3d6896a7e29b6cb41d202b77b3b3cba380 Mon Sep 17 00:00:00 2001 From: Takashi Sawanaka Date: Fri, 5 Jul 2019 08:17:55 +0900 Subject: [PATCH] Reduce the size of the executable file (3) --- Src/Common/OptionsMgr.cpp | 18 ------ Src/Common/OptionsMgr.h | 18 ++++++ Src/Common/ShellFileOperations.cpp | 9 --- Src/Common/ShellFileOperations.h | 10 ++++ Src/Common/UniFile.cpp | 78 ------------------------ Src/Common/UniFile.h | 79 ++++++++++++++++++++++++ Src/Common/VersionInfo.cpp | 99 ------------------------------ Src/Common/VersionInfo.h | 100 +++++++++++++++++++++++++++++++ Src/CompareStats.cpp | 35 ----------- Src/CompareStats.h | 35 +++++++++++ Src/ConfigLog.cpp | 10 ---- Src/ConfigLog.h | 8 +++ Src/DiffFileInfo.cpp | 8 --- Src/DiffFileInfo.h | 8 +++ Src/DiffList.cpp | 59 ------------------ Src/DiffList.h | 58 ++++++++++++++++++ Src/DiffTextBuffer.cpp | 18 ------ Src/DiffTextBuffer.h | 19 ++++++ Src/DiffThread.cpp | 17 ------ Src/DiffThread.h | 17 ++++++ Src/DiffWrapper.cpp | 44 -------------- Src/DiffWrapper.h | 48 +++++++++++++++ Src/DirCompProgressBar.cpp | 9 --- Src/DirCompProgressBar.h | 9 +++ Src/DirDoc.cpp | 24 -------- Src/DirDoc.h | 25 ++++++++ Src/DirFrame.cpp | 7 --- Src/DirFrame.h | 7 +++ Src/DirScan.cpp | 1 + Src/EditorFilepathBar.cpp | 13 ---- Src/EditorFilepathBar.h | 14 +++++ Src/FileActionScript.cpp | 27 --------- Src/FileActionScript.h | 28 +++++++++ Src/FileFilterHelper.cpp | 16 ----- Src/FileFilterHelper.h | 17 ++++++ Src/FileFilterMgr.cpp | 64 -------------------- Src/FileFilterMgr.h | 64 ++++++++++++++++++++ Src/FileVersion.cpp | 19 ------ Src/FileVersion.h | 20 +++++++ Src/FilepathEdit.cpp | 9 --- Src/FilepathEdit.h | 10 ++++ Src/FilterList.cpp | 26 -------- Src/FilterList.h | 27 +++++++++ Src/HexMergeFrm.cpp | 6 -- Src/HexMergeFrm.h | 6 ++ Src/LineFiltersList.cpp | 17 ------ Src/LineFiltersList.h | 17 ++++++ Src/LocationView.cpp | 8 --- Src/LocationView.h | 9 +++ Src/Merge.cpp | 9 --- Src/Merge.h | 10 ++++ Src/MergeDoc.cpp | 8 --- Src/MergeDoc.h | 9 +++ Src/MergeEditView.cpp | 19 ------ Src/MergeEditView.h | 20 +++++++ Src/PatchDlg.cpp | 36 ----------- Src/PatchDlg.h | 37 ++++++++++++ Src/PathContext.cpp | 55 ----------------- Src/PathContext.h | 46 +++++++++++++- Src/ProjectFile.cpp | 118 ------------------------------------ Src/ProjectFile.h | 119 +++++++++++++++++++++++++++++++++++++ 61 files changed, 892 insertions(+), 888 deletions(-) diff --git a/Src/Common/OptionsMgr.cpp b/Src/Common/OptionsMgr.cpp index 7f5e589b7..7341f9737 100644 --- a/Src/Common/OptionsMgr.cpp +++ b/Src/Common/OptionsMgr.cpp @@ -119,24 +119,6 @@ int COption::Init(const String& name, const varprop::VariantValue& defaultValue) } /** - * @brief Return option value. - * @return Value as Variant type. - */ -const varprop::VariantValue& COption::Get() const -{ - return m_value; -} - -/** - * @brief Return option default value. - * @return Default value as varian type. - */ -const varprop::VariantValue& COption::GetDefault() const -{ - return m_valueDef; -} - -/** * @brief Convert string to integer. * @param [in] str String to convert. * @param [out] val Converted integer. diff --git a/Src/Common/OptionsMgr.h b/Src/Common/OptionsMgr.h index a499c4804..53f0a3c9c 100644 --- a/Src/Common/OptionsMgr.h +++ b/Src/Common/OptionsMgr.h @@ -73,6 +73,24 @@ private: varprop::VariantValue m_valueDef; /**< Option's default value. */ }; +/** + * @brief Return option value. + * @return Value as Variant type. + */ +inline const varprop::VariantValue& COption::Get() const +{ + return m_value; +} + +/** + * @brief Return option default value. + * @return Default value as varian type. + */ +inline const varprop::VariantValue& COption::GetDefault() const +{ + return m_valueDef; +} + typedef std::map OptionsMap; /** diff --git a/Src/Common/ShellFileOperations.cpp b/Src/Common/ShellFileOperations.cpp index 145b41c8c..7446f6428 100644 --- a/Src/Common/ShellFileOperations.cpp +++ b/Src/Common/ShellFileOperations.cpp @@ -190,15 +190,6 @@ bool ShellFileOperations::Run() } /** - * @brief Did the user cancel the operation? - * @return true if the operation was canceled by the user. - */ -bool ShellFileOperations::IsCanceled() const -{ - return m_isCanceled; -} - -/** * @brief Reset the class. */ void ShellFileOperations::Reset() diff --git a/Src/Common/ShellFileOperations.h b/Src/Common/ShellFileOperations.h index c069d53be..05fd78e69 100644 --- a/Src/Common/ShellFileOperations.h +++ b/Src/Common/ShellFileOperations.h @@ -57,3 +57,13 @@ private: bool m_bOneToOneMapping; /**< Same amount of sources and destinations? */ bool m_isCanceled; /**< Did user cancel the operation? */ }; + +/** + * @brief Did the user cancel the operation? + * @return true if the operation was canceled by the user. + */ +inline bool ShellFileOperations::IsCanceled() const +{ + return m_isCanceled; +} + diff --git a/Src/Common/UniFile.cpp b/Src/Common/UniFile.cpp index 84423b415..486aa79f6 100644 --- a/Src/Common/UniFile.cpp +++ b/Src/Common/UniFile.cpp @@ -55,32 +55,6 @@ UniFile::UniError::UniError() ClearError(); } -/** - * @brief Check if there is error. - * @return true if there is an error. - */ -bool UniFile::UniError::HasError() const -{ - return !desc.empty(); -} - -/** - * @brief Clears the existing error. - */ -void UniFile::UniError::ClearError() -{ - desc.erase(); -} - -/** - * @brief Get the error string. - * @return Error string. - */ -String UniFile::UniError::GetError() const -{ - return desc; -} - ///////////// // UniLocalFile ///////////// @@ -199,15 +173,6 @@ void UniMemFile::Close() } } -/** @brief Is it currently attached to a file ? */ -bool UniMemFile::IsOpen() const -{ - // We don't test the handle here, because we allow "opening" empty file - // but memory-mapping doesn't work on that, so that uses a special state - // of no handle, but linenumber of 0 - return m_lineno >= 0; -} - /** @brief Get file status into member variables */ bool UniMemFile::GetFileStatus() { @@ -355,24 +320,6 @@ bool UniMemFile::ReadBom() } /** - * @brief Returns if file has a BOM bytes. - * @return true if file has BOM bytes, false otherwise. - */ -bool UniMemFile::HasBom() const -{ - return m_bom; -} - -/** - * @brief Sets if file has BOM or not. - * @param [in] true to have a BOM in file, false to not to have. - */ -void UniMemFile::SetBom(bool bom) -{ - m_bom = bom; -} - -/** * @brief Read one (DOS or UNIX or Mac) line. Do not include eol chars. * @param [out] line Line read. * @param [out] lossy `true` if there were lossy encoding. @@ -729,12 +676,6 @@ void UniStdioFile::Close() m_txtstats.clear(); } -/** @brief Is it currently attached to a file ? */ -bool UniStdioFile::IsOpen() const -{ - return m_fp != 0; -} - /** @brief Get file status into member variables */ bool UniStdioFile::GetFileStatus() { @@ -861,25 +802,6 @@ bool UniStdioFile::ReadBom() return unicode; } -/** - * @brief Returns if file has a BOM bytes. - * @return true if file has BOM bytes, false otherwise. - */ -bool UniStdioFile::HasBom() const -{ - return m_bom; -} - -/** - * @brief Sets if file has BOM or not. - * @param [in] true to have a BOM in file, false to not to have. - */ -void UniStdioFile::SetBom(bool bom) -{ - m_bom = bom; -} - - bool UniStdioFile::ReadString(String & line, bool * lossy) { assert(false); // unimplemented -- currently cannot read from a UniStdioFile! diff --git a/Src/Common/UniFile.h b/Src/Common/UniFile.h index 3b6318ebc..a049bf438 100644 --- a/Src/Common/UniFile.h +++ b/Src/Common/UniFile.h @@ -71,6 +71,32 @@ public: }; /** + * @brief Check if there is error. + * @return true if there is an error. + */ +inline bool UniFile::UniError::HasError() const +{ + return !desc.empty(); +} + +/** + * @brief Clears the existing error. + */ +inline void UniFile::UniError::ClearError() +{ + desc.erase(); +} + +/** + * @brief Get the error string. + * @return Error string. + */ +inline String UniFile::UniError::GetError() const +{ + return desc; +} + +/** * @brief Local file access code used by both UniMemFile and UniStdioFile * * This class lacks an actual handle to a file @@ -181,6 +207,33 @@ private: unsigned char *m_current; // current location in file }; +/** @brief Is it currently attached to a file ? */ +inline bool UniMemFile::IsOpen() const +{ + // We don't test the handle here, because we allow "opening" empty file + // but memory-mapping doesn't work on that, so that uses a special state + // of no handle, but linenumber of 0 + return m_lineno >= 0; +} + +/** + * @brief Returns if file has a BOM bytes. + * @return true if file has BOM bytes, false otherwise. + */ +inline bool UniMemFile::HasBom() const +{ + return m_bom; +} + +/** + * @brief Sets if file has BOM or not. + * @param [in] true to have a BOM in file, false to not to have. + */ +inline void UniMemFile::SetBom(bool bom) +{ + m_bom = bom; +} + /** * @brief Regular buffered file (write-only access) * (ReadString methods have never been implemented, @@ -227,3 +280,29 @@ private: int64_t m_data; // offset after any initial BOM ucr::buffer m_ucrbuff; }; + +/** @brief Is it currently attached to a file ? */ +inline bool UniStdioFile::IsOpen() const +{ + return m_fp != 0; +} + +/** + * @brief Returns if file has a BOM bytes. + * @return true if file has BOM bytes, false otherwise. + */ +inline bool UniStdioFile::HasBom() const +{ + return m_bom; +} + +/** + * @brief Sets if file has BOM or not. + * @param [in] true to have a BOM in file, false to not to have. + */ +inline void UniStdioFile::SetBom(bool bom) +{ + m_bom = bom; +} + + diff --git a/Src/Common/VersionInfo.cpp b/Src/Common/VersionInfo.cpp index 80d9f8d90..865dd2d9c 100644 --- a/Src/Common/VersionInfo.cpp +++ b/Src/Common/VersionInfo.cpp @@ -106,96 +106,6 @@ CVersionInfo::CVersionInfo(HINSTANCE hModule) } /** - * @brief Return file version string. - * @return File version as string. - */ -String CVersionInfo::GetFileVersion() const -{ - return m_strFileVersion; -} - -/** - * @brief Return private build value. - * @return Private build number as string. - */ -String CVersionInfo::GetPrivateBuild() const -{ - return m_strPrivateBuild; -} - -/** - * @brief Return special build value. - * @return Special build number as string. - */ -String CVersionInfo::GetSpecialBuild() const -{ - return m_strSpecialBuild; -} - -/** - * @brief Return company name. - * @return Company name. - */ -String CVersionInfo::GetCompanyName() const -{ - return m_strCompanyName; -} - -/** - * @brief Return file description string. - * @return File description string. - */ -String CVersionInfo::GetFileDescription() const -{ - return m_strFileDescription; -} - -/** - * @brief Return internal name. - * @return Internal name. - */ -String CVersionInfo::GetInternalName() const -{ - return m_strInternalName; -} - -/** - * @brief Return full file name. - * @return full file name. - */ -String CVersionInfo::GetFullFileName() const -{ - return m_strFileName; -} - -/** - * @brief Return copyright info. - * @return Copyright info. - */ -String CVersionInfo::GetLegalCopyright() const -{ - return m_strLegalCopyright; -} - -/** - * @brief Return original filename. - * @return Original filename. - */ -String CVersionInfo::GetOriginalFilename() const -{ - return m_strOriginalFilename; -} - -/** - * @brief Return product's version number. - * @return Product's version number as string. - */ -String CVersionInfo::GetProductVersion() const -{ - return m_strProductVersion; -} - -/** * @brief Format version string from numbers. * Version number consists of four WORD (16-bit) numbers. This function * formats those numbers to string, where numbers are separated by @@ -266,15 +176,6 @@ bool CVersionInfo::GetFixedFileVersion(unsigned& versionMS, unsigned& versionLS) } /** - * @brief Return comment string. - * @return Comment string. - */ -String CVersionInfo::GetComments() const -{ - return m_strComments; -} - -/** * @brief Read version info from file. * This function reads version information from file's version resource * to member variables. diff --git a/Src/Common/VersionInfo.h b/Src/Common/VersionInfo.h index 6fe003c19..4c2d99d70 100644 --- a/Src/Common/VersionInfo.h +++ b/Src/Common/VersionInfo.h @@ -74,3 +74,103 @@ protected: void QueryValue(LPCTSTR szId, String& s); bool GetCodepageForLanguage(WORD wLanguage, WORD & wCodePage); }; + +/** + * @brief Return file version string. + * @return File version as string. + */ +inline String CVersionInfo::GetFileVersion() const +{ + return m_strFileVersion; +} + +/** + * @brief Return private build value. + * @return Private build number as string. + */ +inline String CVersionInfo::GetPrivateBuild() const +{ + return m_strPrivateBuild; +} + +/** + * @brief Return special build value. + * @return Special build number as string. + */ +inline String CVersionInfo::GetSpecialBuild() const +{ + return m_strSpecialBuild; +} + +/** + * @brief Return company name. + * @return Company name. + */ +inline String CVersionInfo::GetCompanyName() const +{ + return m_strCompanyName; +} + +/** + * @brief Return file description string. + * @return File description string. + */ +inline String CVersionInfo::GetFileDescription() const +{ + return m_strFileDescription; +} + +/** + * @brief Return internal name. + * @return Internal name. + */ +inline String CVersionInfo::GetInternalName() const +{ + return m_strInternalName; +} + +/** + * @brief Return full file name. + * @return full file name. + */ +inline String CVersionInfo::GetFullFileName() const +{ + return m_strFileName; +} + +/** + * @brief Return copyright info. + * @return Copyright info. + */ +inline String CVersionInfo::GetLegalCopyright() const +{ + return m_strLegalCopyright; +} + +/** + * @brief Return original filename. + * @return Original filename. + */ +inline String CVersionInfo::GetOriginalFilename() const +{ + return m_strOriginalFilename; +} + +/** + * @brief Return product's version number. + * @return Product's version number as string. + */ +inline String CVersionInfo::GetProductVersion() const +{ + return m_strProductVersion; +} + +/** + * @brief Return comment string. + * @return Comment string. + */ +inline String CVersionInfo::GetComments() const +{ + return m_strComments; +} + diff --git a/Src/CompareStats.cpp b/Src/CompareStats.cpp index 300b629f7..9c26ff98b 100644 --- a/Src/CompareStats.cpp +++ b/Src/CompareStats.cpp @@ -32,15 +32,6 @@ CompareStats::~CompareStats() } /** - * @brief Increase found items (dirs and files) count. - * @param [in] count Amount of items to add. - */ -void CompareStats::IncreaseTotalItems(int count /*= 1*/) -{ - m_nTotalItems += count; -} - -/** * @brief Add compared item. * @param [in] code Resultcode to add. */ @@ -56,24 +47,6 @@ void CompareStats::AddItem(int code) assert(m_nComparedItems <= m_nTotalItems); } -/** - * @brief Return count by resultcode. - * @param [in] result Resultcode to return. - * @return Count of items for given resultcode. - */ -int CompareStats::GetCount(CompareStats::RESULT result) const -{ - return m_counts[result]; -} - -/** - * @brief Return total count of items (so far) found. - */ -int CompareStats::GetTotalItems() const -{ - return m_nTotalItems; -} - /** * @brief Return item taking most time among current items. */ @@ -129,14 +102,6 @@ void CompareStats::SetCompareState(CompareStats::CMP_STATE state) } /** - * @brief Return current comparestate. - */ -CompareStats::CMP_STATE CompareStats::GetCompareState() const -{ - return m_state; -} - -/** * @brief Convert diffcode to compare-result. * @param [in] diffcode DIFFITEM.diffcode to convert. * @return Compare result. diff --git a/Src/CompareStats.h b/Src/CompareStats.h index d219b3ffd..c6c061997 100644 --- a/Src/CompareStats.h +++ b/Src/CompareStats.h @@ -109,3 +109,38 @@ private: std::vector m_rgThreadState; }; + +/** + * @brief Increase found items (dirs and files) count. + * @param [in] count Amount of items to add. + */ +inline void CompareStats::IncreaseTotalItems(int count) +{ + m_nTotalItems += count; +} + +/** + * @brief Return count by resultcode. + * @param [in] result Resultcode to return. + * @return Count of items for given resultcode. + */ +inline int CompareStats::GetCount(CompareStats::RESULT result) const +{ + return m_counts[result]; +} + +/** + * @brief Return total count of items (so far) found. + */ +inline int CompareStats::GetTotalItems() const +{ + return m_nTotalItems; +} + +/** + * @brief Return current comparestate. + */ +inline CompareStats::CMP_STATE CompareStats::GetCompareState() const +{ + return m_state; +} diff --git a/Src/ConfigLog.cpp b/Src/ConfigLog.cpp index a2fd79dee..f7866d097 100644 --- a/Src/ConfigLog.cpp +++ b/Src/ConfigLog.cpp @@ -84,16 +84,6 @@ static String GetCompilerVersion() ); } - -/** - * @brief Return logfile name and path - */ -String CConfigLog::GetFileName() const -{ - return m_sFileName; -} - - /** * @brief Get the Modified time of fully qualified file path and name */ diff --git a/Src/ConfigLog.h b/Src/ConfigLog.h index 12235cc0e..e1c78e07d 100644 --- a/Src/ConfigLog.h +++ b/Src/ConfigLog.h @@ -62,3 +62,11 @@ private: String m_sFileName; std::unique_ptr m_pfile; }; + +/** + * @brief Return logfile name and path + */ +inline String CConfigLog::GetFileName() const +{ + return m_sFileName; +} diff --git a/Src/DiffFileInfo.cpp b/Src/DiffFileInfo.cpp index 04840cb4f..34dc509db 100644 --- a/Src/DiffFileInfo.cpp +++ b/Src/DiffFileInfo.cpp @@ -33,11 +33,3 @@ void DiffFileInfo::ClearPartial() encoding.Clear(); m_textStats.clear(); } - -/** - * @brief Return true if file is in any Unicode encoding - */ -bool DiffFileInfo::IsEditableEncoding() const -{ - return !encoding.m_bom; -} diff --git a/Src/DiffFileInfo.h b/Src/DiffFileInfo.h index 1e899e01c..fcc464ea8 100644 --- a/Src/DiffFileInfo.h +++ b/Src/DiffFileInfo.h @@ -47,3 +47,11 @@ struct DiffFileInfo : public DirItem void ClearPartial(); bool IsEditableEncoding() const; }; + +/** + * @brief Return true if file is in any Unicode encoding + */ +inline bool DiffFileInfo::IsEditableEncoding() const +{ + return !encoding.m_bom; +} diff --git a/Src/DiffList.cpp b/Src/DiffList.cpp index f81b00e3a..749c2379a 100644 --- a/Src/DiffList.cpp +++ b/Src/DiffList.cpp @@ -100,17 +100,6 @@ void DiffList::Clear() } /** - * @brief Returns count of items in diff list. - * This function returns total amount of items (diffs) in list. So returned - * count includes significant and non-significant diffs. - * @note Use GetSignificantDiffs() to get count of non-ignored diffs. - */ -int DiffList::GetSize() const -{ - return (int) m_diffs.size(); -} - -/** * @brief Returns count of significant diffs in the list. * This function returns total count of significant diffs in list. So returned * count doesn't include non-significant diffs. @@ -380,17 +369,6 @@ bool DiffList::GetNextDiff(int nLine, int & nDiff) const } /** - * @brief Check if diff-list contains significant diffs. - * @return true if list has significant diffs, false otherwise. - */ -bool DiffList::HasSignificantDiffs() const -{ - if (m_firstSignificant == -1) - return false; - return true; -} - -/** * @brief Return previous diff index from given line. * @param [in] nLine First line searched. * @return Index for next difference or -1 if no difference is found. @@ -515,43 +493,6 @@ void DiffList::ConstructSignificantChain() } } -/** - * @brief Return index to first significant difference. - * @return Index of first significant difference. - */ -int DiffList::FirstSignificantDiff() const -{ - return m_firstSignificant; -} - -/** - * @brief Return index of next significant diff. - * @param [in] nDiff Index to start looking for next diff. - * @return Index of next significant difference. - */ -int DiffList::NextSignificantDiff(int nDiff) const -{ - return (int)m_diffs[nDiff].next; -} - -/** - * @brief Return index of previous significant diff. - * @param [in] nDiff Index to start looking for previous diff. - * @return Index of previous significant difference. - */ -int DiffList::PrevSignificantDiff(int nDiff) const -{ - return (int)m_diffs[nDiff].prev; -} - -/** - * @brief Return index to last significant diff. - * @return Index of last significant difference. - */ -int DiffList::LastSignificantDiff() const -{ - return m_lastSignificant; -} /** * @brief Return pointer to first significant diff. diff --git a/Src/DiffList.h b/Src/DiffList.h index e34d6e9d1..37a3f7577 100644 --- a/Src/DiffList.h +++ b/Src/DiffList.h @@ -189,3 +189,61 @@ private: int m_lastSignificantRightOnly; int m_lastSignificantConflict; }; + +/** + * @brief Returns count of items in diff list. + * This function returns total amount of items (diffs) in list. So returned + * count includes significant and non-significant diffs. + * @note Use GetSignificantDiffs() to get count of non-ignored diffs. + */ +inline int DiffList::GetSize() const +{ + return (int) m_diffs.size(); +} + +/** + * @brief Check if diff-list contains significant diffs. + * @return true if list has significant diffs, false otherwise. + */ +inline bool DiffList::HasSignificantDiffs() const +{ + return (m_firstSignificant != -1); +} + +/** + * @brief Return index to first significant difference. + * @return Index of first significant difference. + */ +inline int DiffList::FirstSignificantDiff() const +{ + return m_firstSignificant; +} + +/** + * @brief Return index of next significant diff. + * @param [in] nDiff Index to start looking for next diff. + * @return Index of next significant difference. + */ +inline int DiffList::NextSignificantDiff(int nDiff) const +{ + return (int)m_diffs[nDiff].next; +} + +/** + * @brief Return index of previous significant diff. + * @param [in] nDiff Index to start looking for previous diff. + * @return Index of previous significant difference. + */ +inline int DiffList::PrevSignificantDiff(int nDiff) const +{ + return (int)m_diffs[nDiff].prev; +} + +/** + * @brief Return index to last significant diff. + * @return Index of last significant difference. + */ +inline int DiffList::LastSignificantDiff() const +{ + return m_lastSignificant; +} diff --git a/Src/DiffTextBuffer.cpp b/Src/DiffTextBuffer.cpp index bf5027b17..9d9ba0260 100644 --- a/Src/DiffTextBuffer.cpp +++ b/Src/DiffTextBuffer.cpp @@ -205,24 +205,6 @@ OnNotifyLineHasBeenEdited(int nLine) } /** - * @brief Set the folder for temp files. - * @param [in] path Temp files folder. - */ -void CDiffTextBuffer::SetTempPath(const String &path) -{ - m_strTempPath = path; -} - -/** - * @brief Is the buffer initialized? - * @return true if the buffer is initialized, false otherwise. - */ -bool CDiffTextBuffer::IsInitialized() const -{ - return !!m_bInit; -} - -/** * @brief Load file from disk into buffer * * @param [in] pszFileNameInit File to load diff --git a/Src/DiffTextBuffer.h b/Src/DiffTextBuffer.h index ad8ff7871..1eb6bf5d2 100644 --- a/Src/DiffTextBuffer.h +++ b/Src/DiffTextBuffer.h @@ -80,3 +80,22 @@ public : int nStartPos, int nEndLine, int nEndPos, int nAction = CE_ACTION_UNKNOWN, bool bHistory = true) override; }; + +/** + * @brief Set the folder for temp files. + * @param [in] path Temp files folder. + */ +inline void CDiffTextBuffer::SetTempPath(const String &path) +{ + m_strTempPath = path; +} + +/** + * @brief Is the buffer initialized? + * @return true if the buffer is initialized, false otherwise. + */ +inline bool CDiffTextBuffer::IsInitialized() const +{ + return !!m_bInit; +} + diff --git a/Src/DiffThread.cpp b/Src/DiffThread.cpp index 69507afbf..97d130e15 100644 --- a/Src/DiffThread.cpp +++ b/Src/DiffThread.cpp @@ -72,15 +72,6 @@ CDiffThread::~CDiffThread() } /** - * @brief Sets context pointer forwarded to thread. - * @param [in] pCtx Pointer to compare context. - */ -void CDiffThread::SetContext(CDiffContext * pCtx) -{ - m_pDiffContext = pCtx; -} - -/** * @brief runtime interface for child thread, called on child thread */ bool CDiffThread::ShouldAbort() const @@ -117,14 +108,6 @@ unsigned CDiffThread::CompareDirectories() } /** - * @brief Returns thread's current state - */ -unsigned CDiffThread::GetThreadState() const -{ - return m_pDiffParm->nThreadState; -} - -/** * @brief Item collection thread function. * * This thread is responsible for finding and collecting all items to compare diff --git a/Src/DiffThread.h b/Src/DiffThread.h index 62ea77df1..738009efb 100644 --- a/Src/DiffThread.h +++ b/Src/DiffThread.h @@ -118,3 +118,20 @@ private: bool m_bAborting; /**< Is compare aborting? */ bool m_bPaused; /**< Is compare paused? */ }; + +/** + * @brief Sets context pointer forwarded to thread. + * @param [in] pCtx Pointer to compare context. + */ +inline void CDiffThread::SetContext(CDiffContext * pCtx) +{ + m_pDiffContext = pCtx; +} + +/** + * @brief Returns thread's current state + */ +inline unsigned CDiffThread::GetThreadState() const +{ + return m_pDiffParm->nThreadState; +} diff --git a/Src/DiffWrapper.cpp b/Src/DiffWrapper.cpp index 678c57179..015edde31 100644 --- a/Src/DiffWrapper.cpp +++ b/Src/DiffWrapper.cpp @@ -102,15 +102,6 @@ CDiffWrapper::~CDiffWrapper() } /** - * @brief Set plugins enabled/disabled. - * @param [in] enable if true plugins are enabled. - */ -void CDiffWrapper::EnablePlugins(bool enable) -{ - m_bPluginsEnabled = enable; -} - -/** * @brief Enables/disables patch-file creation and sets filename. * This function enables or disables patch file creation. When * @p filename is empty, patch files are disabled. @@ -178,14 +169,6 @@ void CDiffWrapper::SetOptions(const DIFFOPTIONS *options) m_options.SetFromDiffOptions(*options); } -/** - * @brief Set text tested to find the prediffer automatically. - * Most probably a concatenated string of both filenames. - */ -void CDiffWrapper::SetTextForAutomaticPrediff(const String &text) -{ - m_sToFindPrediffer = text; -} void CDiffWrapper::SetPrediffer(const PrediffingInfo * prediffer /*= nullptr*/) { // all flags are set correctly during the construction @@ -194,10 +177,6 @@ void CDiffWrapper::SetPrediffer(const PrediffingInfo * prediffer /*= nullptr*/) if (prediffer != nullptr) *m_infoPrediffer = *prediffer; } -void CDiffWrapper::GetPrediffer(PrediffingInfo * prediffer) const -{ - *prediffer = *m_infoPrediffer; -} /** * @brief Set options used for patch-file creation. @@ -661,29 +640,6 @@ void CDiffWrapper::SetPaths(const PathContext &tFiles, } /** - * @brief Set source paths for original (NON-TEMP) diffing two files. - * Sets full paths to two (NON-TEMP) files we are diffing. - * @param [in] OriginalFile1 First file to compare "(NON-TEMP) file". - * @param [in] OriginalFile2 Second file to compare "(NON-TEMP) file". - */ -void CDiffWrapper::SetCompareFiles(const PathContext &originalFile) -{ - m_originalFile = originalFile; -} - -/** - * @brief Set alternative paths for compared files. - * Sets alternative paths for diff'ed files. These alternative paths might not - * be real paths. For example when creating a patch file from folder compare - * we want to use relative paths. - * @param [in] altPaths Alternative file paths. - */ -void CDiffWrapper::SetAlternativePaths(const PathContext &altPaths) -{ - m_alternativePaths = altPaths; -} - -/** * @brief Runs diff-engine. */ bool CDiffWrapper::RunFileDiff() diff --git a/Src/DiffWrapper.h b/Src/DiffWrapper.h index bc0b8bc1a..d78ccaa52 100644 --- a/Src/DiffWrapper.h +++ b/Src/DiffWrapper.h @@ -30,6 +30,7 @@ #include "CompareOptions.h" #include "DiffList.h" #include "UnicodeString.h" +#include "FileTransform.h" class CDiffContext; class PrediffingInfo; @@ -240,3 +241,50 @@ private: const FilterCommentsManager* m_pFilterCommentsManager; /**< Comments filtering manager */ bool m_bPluginsEnabled; /**< Are plugins enabled? */ }; + +/** + * @brief Set text tested to find the prediffer automatically. + * Most probably a concatenated string of both filenames. + */ +inline void CDiffWrapper::SetTextForAutomaticPrediff(const String &text) +{ + m_sToFindPrediffer = text; +} + +inline void CDiffWrapper::GetPrediffer(PrediffingInfo * prediffer) const +{ + *prediffer = *m_infoPrediffer; +} + +/** + * @brief Set plugins enabled/disabled. + * @param [in] enable if true plugins are enabled. + */ +inline void CDiffWrapper::EnablePlugins(bool enable) +{ + m_bPluginsEnabled = enable; +} + +/** + * @brief Set source paths for original (NON-TEMP) diffing two files. + * Sets full paths to two (NON-TEMP) files we are diffing. + * @param [in] OriginalFile1 First file to compare "(NON-TEMP) file". + * @param [in] OriginalFile2 Second file to compare "(NON-TEMP) file". + */ +inline void CDiffWrapper::SetCompareFiles(const PathContext &originalFile) +{ + m_originalFile = originalFile; +} + +/** + * @brief Set alternative paths for compared files. + * Sets alternative paths for diff'ed files. These alternative paths might not + * be real paths. For example when creating a patch file from folder compare + * we want to use relative paths. + * @param [in] altPaths Alternative file paths. + */ +inline void CDiffWrapper::SetAlternativePaths(const PathContext &altPaths) +{ + m_alternativePaths = altPaths; +} + diff --git a/Src/DirCompProgressBar.cpp b/Src/DirCompProgressBar.cpp index 2ee64ff93..46a2095f8 100644 --- a/Src/DirCompProgressBar.cpp +++ b/Src/DirCompProgressBar.cpp @@ -87,15 +87,6 @@ BOOL DirCompProgressBar::Create(CWnd* pParentWnd) // EXCEPTION: OCX Property Pages should return FALSE } -/** - * @brief Set pointer to compare stats. - * @param [in] pCompareStats Pointer to stats. - */ -void DirCompProgressBar::SetCompareStat(CompareStats * pCompareStats) -{ - m_pCompareStats = pCompareStats; -} - void DirCompProgressBar::SetProgressState(int comparedItems, int totalItems) { CProgressCtrl *pProg = (CProgressCtrl*) GetDlgItem(IDC_PROGRESSCOMPARE); diff --git a/Src/DirCompProgressBar.h b/Src/DirCompProgressBar.h index 2e20c5b58..972486113 100644 --- a/Src/DirCompProgressBar.h +++ b/Src/DirCompProgressBar.h @@ -68,3 +68,12 @@ private: #endif }; +/** + * @brief Set pointer to compare stats. + * @param [in] pCompareStats Pointer to stats. + */ +inline void DirCompProgressBar::SetCompareStat(CompareStats * pCompareStats) +{ + m_pCompareStats = pCompareStats; +} + diff --git a/Src/DirDoc.cpp b/Src/DirDoc.cpp index d38a57225..b98f789f2 100644 --- a/Src/DirDoc.cpp +++ b/Src/DirDoc.cpp @@ -562,30 +562,6 @@ void CDirDoc::RefreshOptions() } /** - * @brief Set left/middle/right side readonly-status - * @param nIndex Select side to set - * @param bReadOnly New status of selected side - */ -void CDirDoc::SetReadOnly(int nIndex, bool bReadOnly) -{ - m_bRO[nIndex] = bReadOnly; -} - -/** - * @brief Return left/middle/right side readonly-status - * @param nIndex Select side to ask - */ -bool CDirDoc::GetReadOnly(int nIndex) const -{ - return m_bRO[nIndex]; -} - -const bool *CDirDoc::GetReadOnly(void) const -{ - return m_bRO; -} - -/** * @brief Write path and filename to headerbar * @note SetText() does not repaint unchanged text */ diff --git a/Src/DirDoc.h b/Src/DirDoc.h index e2717eb79..091b62de6 100644 --- a/Src/DirDoc.h +++ b/Src/DirDoc.h @@ -147,3 +147,28 @@ private: bool m_bGeneratingReport; std::unique_ptr m_pReport; }; + +/** + * @brief Set left/middle/right side readonly-status + * @param nIndex Select side to set + * @param bReadOnly New status of selected side + */ +inline void CDirDoc::SetReadOnly(int nIndex, bool bReadOnly) +{ + m_bRO[nIndex] = bReadOnly; +} + +/** + * @brief Return left/middle/right side readonly-status + * @param nIndex Select side to ask + */ +inline bool CDirDoc::GetReadOnly(int nIndex) const +{ + return m_bRO[nIndex]; +} + +inline const bool *CDirDoc::GetReadOnly(void) const +{ + return m_bRO; +} + diff --git a/Src/DirFrame.cpp b/Src/DirFrame.cpp index 747b58967..35db54d34 100644 --- a/Src/DirFrame.cpp +++ b/Src/DirFrame.cpp @@ -170,13 +170,6 @@ void CDirFrame::SetFilterStatusDisplay(LPCTSTR szFilter) } /** - * @brief Get the interface to the header (path) bar - */ -IHeaderBar * CDirFrame::GetHeaderInterface() { - return &m_wndFilePathBar; -} - -/** * @brief Restore maximized state of directory compare window */ void CDirFrame::ActivateFrame(int nCmdShow) diff --git a/Src/DirFrame.h b/Src/DirFrame.h index 4168e9971..71eaceedb 100644 --- a/Src/DirFrame.h +++ b/Src/DirFrame.h @@ -75,3 +75,10 @@ protected: DECLARE_MESSAGE_MAP() }; +/** + * @brief Get the interface to the header (path) bar + */ +inline IHeaderBar * CDirFrame::GetHeaderInterface() { + return &m_wndFilePathBar; +} + diff --git a/Src/DirScan.cpp b/Src/DirScan.cpp index 19b4c2d71..2bbf08c64 100644 --- a/Src/DirScan.cpp +++ b/Src/DirScan.cpp @@ -35,6 +35,7 @@ #include "MergeApp.h" #include "OptionsDef.h" #include "OptionsMgr.h" +#include "PathContext.h" #include "DebugNew.h" using Poco::NotificationQueue; diff --git a/Src/EditorFilepathBar.cpp b/Src/EditorFilepathBar.cpp index 7d3d81919..2129bb405 100644 --- a/Src/EditorFilepathBar.cpp +++ b/Src/EditorFilepathBar.cpp @@ -89,11 +89,6 @@ CSize CEditorFilePathBar::CalcFixedLayout(BOOL bStretch, BOOL bHorz) return CSize(SHRT_MAX, tm.tmHeight + 6); } -void CEditorFilePathBar::SetPaneCount(int nPanes) -{ - m_nPanes = nPanes; -} - /** * @brief Resize both controls to an equal size. */ @@ -112,14 +107,6 @@ void CEditorFilePathBar::Resize() } /** - * @brief Set callback function on EN_SETFOCUS notification - */ -void CEditorFilePathBar::SetOnSetFocusCallback(const std::function callbackfunc) -{ - m_callbackfunc = callbackfunc; -} - -/** * @brief Set widths. * This function resizes both controls to given size. The width is usually * same as the splitter view width. diff --git a/Src/EditorFilepathBar.h b/Src/EditorFilepathBar.h index d45631052..0531d9dab 100644 --- a/Src/EditorFilepathBar.h +++ b/Src/EditorFilepathBar.h @@ -85,3 +85,17 @@ private: int m_nPanes; std::function m_callbackfunc; }; + +inline void CEditorFilePathBar::SetPaneCount(int nPanes) +{ + m_nPanes = nPanes; +} + +/** + * @brief Set callback function on EN_SETFOCUS notification + */ +inline void CEditorFilePathBar::SetOnSetFocusCallback(const std::function callbackfunc) +{ + m_callbackfunc = callbackfunc; +} + diff --git a/Src/FileActionScript.cpp b/Src/FileActionScript.cpp index bc55839c3..e3eb86a43 100644 --- a/Src/FileActionScript.cpp +++ b/Src/FileActionScript.cpp @@ -68,33 +68,6 @@ FileActionItem FileActionScript::RemoveTailActionItem() } /** - * @brief Set parent window used for showing MessageBoxes. - * @param [in] hWnd Handle to parent window. - */ -void FileActionScript::SetParentWindow(HWND hWnd) -{ - m_hParentWindow = hWnd; -} - -/** - * @brief Does user want to move deleted files to Recycle Bin? - * @param [in] bUseRecycleBin If `true` deleted files are moved to Recycle Bin. - */ -void FileActionScript::UseRecycleBin(bool bUseRecycleBin) -{ - m_bUseRecycleBin = bUseRecycleBin; -} - -/** - * @brief Return amount of actions (copy, move, etc) in script. - * @return Amount of actions. - */ -size_t FileActionScript::GetActionItemCount() const -{ - return m_actions.size(); -} - -/** * @brief Create ShellFileOperations operation lists from our scripts. * * We use ShellFileOperations internally to do actual file operations. diff --git a/Src/FileActionScript.h b/Src/FileActionScript.h index ae2ecf94c..14871f2db 100644 --- a/Src/FileActionScript.h +++ b/Src/FileActionScript.h @@ -149,3 +149,31 @@ private: bool m_bUseRecycleBin; /**< Use recycle bin for script actions? */ HWND m_hParentWindow; /**< Parent window for showing messages */ }; + +/** + * @brief Set parent window used for showing MessageBoxes. + * @param [in] hWnd Handle to parent window. + */ +inline void FileActionScript::SetParentWindow(HWND hWnd) +{ + m_hParentWindow = hWnd; +} + +/** + * @brief Does user want to move deleted files to Recycle Bin? + * @param [in] bUseRecycleBin If `true` deleted files are moved to Recycle Bin. + */ +inline void FileActionScript::UseRecycleBin(bool bUseRecycleBin) +{ + m_bUseRecycleBin = bUseRecycleBin; +} + +/** + * @brief Return amount of actions (copy, move, etc) in script. + * @return Amount of actions. + */ +inline size_t FileActionScript::GetActionItemCount() const +{ + return m_actions.size(); +} + diff --git a/Src/FileFilterHelper.cpp b/Src/FileFilterHelper.cpp index 60ede23d7..4261246b5 100644 --- a/Src/FileFilterHelper.cpp +++ b/Src/FileFilterHelper.cpp @@ -50,14 +50,6 @@ FileFilterHelper::~FileFilterHelper() { } -/** - * @brief Return filtermanager used. - */ -FileFilterMgr * FileFilterHelper::GetManager() const -{ - return m_fileFilterMgr.get(); -} - /** * @brief Store current filter path. * @@ -331,14 +323,6 @@ String FileFilterHelper::ParseExtensions(const String &extensions) const } /** - * @brief Returns true if active filter is a mask. - */ -bool FileFilterHelper::IsUsingMask() const -{ - return m_bUseMask; -} - -/** * @brief Returns active filter (or mask string) * @return The active filter. */ diff --git a/Src/FileFilterHelper.h b/Src/FileFilterHelper.h index 6fd734845..a62f61fde 100644 --- a/Src/FileFilterHelper.h +++ b/Src/FileFilterHelper.h @@ -159,3 +159,20 @@ private: String m_sGlobalFilterPath; /*< Path for shared filters */ String m_sUserSelFilterPath; /*< Path for user's private filters */ }; + +/** + * @brief Return filtermanager used. + */ +inline FileFilterMgr * FileFilterHelper::GetManager() const +{ + return m_fileFilterMgr.get(); +} + +/** + * @brief Returns true if active filter is a mask. + */ +inline bool FileFilterHelper::IsUsingMask() const +{ + return m_bUseMask; +} + diff --git a/Src/FileFilterMgr.cpp b/Src/FileFilterMgr.cpp index 11ef3a73d..3f391241f 100644 --- a/Src/FileFilterMgr.cpp +++ b/Src/FileFilterMgr.cpp @@ -340,70 +340,6 @@ bool FileFilterMgr::TestDirNameAgainstFilter(const FileFilter * pFilter, } /** - * @brief Return name of filter. - * - * @param [in] i Index of filter. - * @return Name of filter in given index. - */ -String FileFilterMgr::GetFilterName(int i) const -{ - return m_filters[i]->name; -} - -/** - * @brief Return name of filter. - * @param [in] pFilter Filter to get name for. - * @return Given filter's name. - */ -String FileFilterMgr::GetFilterName(const FileFilter *pFilter) const -{ - return pFilter->name; -} - -/** - * @brief Return description of filter. - * - * @param [in] i Index of filter. - * @return Description of filter in given index. - */ -String FileFilterMgr::GetFilterDesc(int i) const -{ - return m_filters[i]->description; -} - -/** - * @brief Return description of filter. - * @param [in] pFilter Filter to get description for. - * @return Given filter's description. - */ -String FileFilterMgr::GetFilterDesc(const FileFilter *pFilter) const -{ - return pFilter->description; -} - -/** - * @brief Return full path to filter. - * - * @param [in] i Index of filter. - * @return Full path of filter in given index. - */ -String FileFilterMgr::GetFilterPath(int i) const -{ - return m_filters[i]->fullpath; -} - -/** - * @brief Return full path to filter. - * - * @param [in] pFilter Pointer to filter. - * @return Full path of filter. - */ -String FileFilterMgr::GetFullpath(FileFilter * pfilter) const -{ - return pfilter->fullpath; -} - -/** * @brief Reload filter from disk * * Reloads filter from disk. This is done by creating a new one diff --git a/Src/FileFilterMgr.h b/Src/FileFilterMgr.h index 10ee1d74d..8f5751543 100644 --- a/Src/FileFilterMgr.h +++ b/Src/FileFilterMgr.h @@ -91,3 +91,67 @@ private: bool TestAgainstRegList(const std::vector *filterList, const String& szTest); void EmptyFilterList(std::vector *filterList); + +/** + * @brief Return name of filter. + * + * @param [in] i Index of filter. + * @return Name of filter in given index. + */ +inline String FileFilterMgr::GetFilterName(int i) const +{ + return m_filters[i]->name; +} + +/** + * @brief Return name of filter. + * @param [in] pFilter Filter to get name for. + * @return Given filter's name. + */ +inline String FileFilterMgr::GetFilterName(const FileFilter *pFilter) const +{ + return pFilter->name; +} + +/** + * @brief Return description of filter. + * + * @param [in] i Index of filter. + * @return Description of filter in given index. + */ +inline String FileFilterMgr::GetFilterDesc(int i) const +{ + return m_filters[i]->description; +} + +/** + * @brief Return description of filter. + * @param [in] pFilter Filter to get description for. + * @return Given filter's description. + */ +inline String FileFilterMgr::GetFilterDesc(const FileFilter *pFilter) const +{ + return pFilter->description; +} + +/** + * @brief Return full path to filter. + * + * @param [in] i Index of filter. + * @return Full path of filter in given index. + */ +inline String FileFilterMgr::GetFilterPath(int i) const +{ + return m_filters[i]->fullpath; +} + +/** + * @brief Return full path to filter. + * + * @param [in] pFilter Pointer to filter. + * @return Full path of filter. + */ +inline String FileFilterMgr::GetFullpath(FileFilter * pfilter) const +{ + return pfilter->fullpath; +} diff --git a/Src/FileVersion.cpp b/Src/FileVersion.cpp index e9744f75e..5e49f73ed 100644 --- a/Src/FileVersion.cpp +++ b/Src/FileVersion.cpp @@ -23,25 +23,6 @@ FileVersion::FileVersion() } /** - * @brief Reset version data to zeroes. - */ -void FileVersion::Clear() -{ - m_fileVersionMS = m_fileVersionLS = 0xffffffff; -} - -/** - * @brief Set file version number. - * @param [in] versionMS Most significant dword for version. - * @param [in] versionLS Least significant dword for version. - */ -void FileVersion::SetFileVersion(unsigned versionMS, unsigned versionLS) -{ - m_fileVersionMS = versionMS; - m_fileVersionLS = versionLS; -} - -/** * @brief Get file version as a string. * @return File version number as a string. Returns empty string if there is * no version number for the file. diff --git a/Src/FileVersion.h b/Src/FileVersion.h index 69ff6573f..8c08df064 100644 --- a/Src/FileVersion.h +++ b/Src/FileVersion.h @@ -27,3 +27,23 @@ public: String GetFileVersionString() const; uint64_t GetFileVersionQWORD() const { return (static_cast(m_fileVersionMS) << 32) + m_fileVersionLS; }; }; + +/** + * @brief Reset version data to zeroes. + */ +inline void FileVersion::Clear() +{ + m_fileVersionMS = m_fileVersionLS = 0xffffffff; +} + +/** + * @brief Set file version number. + * @param [in] versionMS Most significant dword for version. + * @param [in] versionLS Least significant dword for version. + */ +inline void FileVersion::SetFileVersion(unsigned versionMS, unsigned versionLS) +{ + m_fileVersionMS = versionMS; + m_fileVersionLS = versionLS; +} + diff --git a/Src/FilepathEdit.cpp b/Src/FilepathEdit.cpp index 6b7dfb069..4f87a2969 100644 --- a/Src/FilepathEdit.cpp +++ b/Src/FilepathEdit.cpp @@ -129,15 +129,6 @@ bool CFilepathEdit::SubClassEdit(UINT nID, CWnd* pParent) }; /** - * @brief Return the control's original text. - * @return Control's original text. - */ -void CFilepathEdit::GetOriginalText(String& rString) const -{ - rString = m_sOriginalText; -} - -/** * @brief Set the text to show in the control. * This function sets the text (original text) to show in the control. * The control may modify the text for displaying in the GUI. diff --git a/Src/FilepathEdit.h b/Src/FilepathEdit.h index 490a0a5b2..89386540f 100644 --- a/Src/FilepathEdit.h +++ b/Src/FilepathEdit.h @@ -65,3 +65,13 @@ private: COLORREF m_crBackGnd; /**< Control's background color. */ CBrush m_brBackGnd; /**< Background brush for the control. */ }; + +/** + * @brief Return the control's original text. + * @return Control's original text. + */ +inline void CFilepathEdit::GetOriginalText(String& rString) const +{ + rString = m_sOriginalText; +} + diff --git a/Src/FilterList.cpp b/Src/FilterList.cpp index cf3512b97..a4bf586bc 100644 --- a/Src/FilterList.cpp +++ b/Src/FilterList.cpp @@ -48,23 +48,6 @@ void FilterList::AddRegExp(const std::string& regularExpression) } /** - * @brief Removes all expressions from the list. - */ -void FilterList::RemoveAllFilters() -{ - m_list.clear(); -} - -/** - * @brief Returns if list has any expressions. - * @return true if list contains one or more expressions. - */ -bool FilterList::HasRegExps() const -{ - return !m_list.empty(); -} - -/** * @brief Match string against list of expressions. * This function matches given @p string against the list of regular * expressions. The matching ends when first match is found, so all @@ -114,12 +97,3 @@ bool FilterList::Match(const std::string& string, int codepage/*=CP_UTF8*/) return retval; } -/** - * @brief Returns the last matched expression (if any). - * This function returns the regular expression string that matched last. - * @return Last matched expression, or `nullptr` in case no matches yet. - */ -const char * FilterList::GetLastMatchExpression() const -{ - return m_lastMatchExpression->c_str(); -} diff --git a/Src/FilterList.h b/Src/FilterList.h index 880bce2a9..ae8e2d1a3 100644 --- a/Src/FilterList.h +++ b/Src/FilterList.h @@ -48,3 +48,30 @@ private: const std::string *m_lastMatchExpression; }; + +/** + * @brief Removes all expressions from the list. + */ +inline void FilterList::RemoveAllFilters() +{ + m_list.clear(); +} + +/** + * @brief Returns if list has any expressions. + * @return true if list contains one or more expressions. + */ +inline bool FilterList::HasRegExps() const +{ + return !m_list.empty(); +} + +/** + * @brief Returns the last matched expression (if any). + * This function returns the regular expression string that matched last. + * @return Last matched expression, or `nullptr` in case no matches yet. + */ +inline const char * FilterList::GetLastMatchExpression() const +{ + return m_lastMatchExpression->c_str(); +} diff --git a/Src/HexMergeFrm.cpp b/Src/HexMergeFrm.cpp index 851496d6a..19ac52677 100644 --- a/Src/HexMergeFrm.cpp +++ b/Src/HexMergeFrm.cpp @@ -270,12 +270,6 @@ void CHexMergeFrame::UpdateHeaderSizes() } } -IHeaderBar *CHexMergeFrame::GetHeaderInterface() -{ - return &m_wndFilePathBar; -} - - void CHexMergeFrame::UpdateAutoPaneResize() { m_wndSplitter.AutoResizePanes(GetOptionsMgr()->GetBool(OPT_RESIZE_PANES)); diff --git a/Src/HexMergeFrm.h b/Src/HexMergeFrm.h index 7b02e760f..fa37a80e0 100644 --- a/Src/HexMergeFrm.h +++ b/Src/HexMergeFrm.h @@ -89,3 +89,9 @@ private: //}}AFX_MSG DECLARE_MESSAGE_MAP() }; + +inline IHeaderBar *CHexMergeFrame::GetHeaderInterface() +{ + return &m_wndFilePathBar; +} + diff --git a/Src/LineFiltersList.cpp b/Src/LineFiltersList.cpp index 7f2964163..9f0cf3873 100644 --- a/Src/LineFiltersList.cpp +++ b/Src/LineFiltersList.cpp @@ -45,23 +45,6 @@ void LineFiltersList::AddFilter(const String& filter, bool enabled) } /** - * @brief Returns count of items in the list. - * @return Count of filters in the list. - */ -size_t LineFiltersList::GetCount() const -{ - return m_items.size(); -} - -/** - * @brief Empties the list. - */ -void LineFiltersList::Empty() -{ - m_items.clear(); -} - -/** * @brief Returns the filter list as one filter string. * This function returns the list of filters as one string that can be * given to regular expression engine as filter. Filter strings in diff --git a/Src/LineFiltersList.h b/Src/LineFiltersList.h index 0d1fb2fb2..1f770e47e 100644 --- a/Src/LineFiltersList.h +++ b/Src/LineFiltersList.h @@ -49,3 +49,20 @@ private: std::vector m_items; /**< List for linefilter items */ COptionsMgr * m_pOptionsMgr; /**< Options-manager for storage */ }; + +/** + * @brief Returns count of items in the list. + * @return Count of filters in the list. + */ +inline size_t LineFiltersList::GetCount() const +{ + return m_items.size(); +} + +/** + * @brief Empties the list. + */ +inline void LineFiltersList::Empty() +{ + m_items.clear(); +} diff --git a/Src/LocationView.cpp b/Src/LocationView.cpp index 873646339..2f4ac5299 100644 --- a/Src/LocationView.cpp +++ b/Src/LocationView.cpp @@ -1034,14 +1034,6 @@ void CLocationView::DrawConnectLines(CDC *pClientDC) } /** - * @brief Stores HWND of frame window (CMergeEditFrame). - */ -void CLocationView::SetFrameHwnd(HWND hwndFrame) -{ - m_hwndFrame = hwndFrame; -} - -/** * @brief Request frame window to store sizes. * * When locationview size changes we want to save new size diff --git a/Src/LocationView.h b/Src/LocationView.h index 3dfb723e5..a5708fad2 100644 --- a/Src/LocationView.h +++ b/Src/LocationView.h @@ -131,3 +131,12 @@ protected: inline CMergeDoc* CLocationView::GetDocument() { return reinterpret_cast(m_pDocument); } #endif + +/** + * @brief Stores HWND of frame window (CMergeEditFrame). + */ +inline void CLocationView::SetFrameHwnd(HWND hwndFrame) +{ + m_hwndFrame = hwndFrame; +} + diff --git a/Src/Merge.cpp b/Src/Merge.cpp index 783f848c4..d38f86b1b 100644 --- a/Src/Merge.cpp +++ b/Src/Merge.cpp @@ -517,15 +517,6 @@ int CMergeApp::DoMessageBox(LPCTSTR lpszPrompt, UINT nType, UINT nIDPrompt) return static_cast(dlgMessage.DoModal()); } -/** - * @brief Set flag so that application will broadcast notification at next - * idle time (via WM_TIMER id=IDLE_TIMER) - */ -void CMergeApp::SetNeedIdleTimer() -{ - m_bNeedIdleTimer = true; -} - bool CMergeApp::IsReallyIdle() const { bool idle = true; diff --git a/Src/Merge.h b/Src/Merge.h index 47e15a880..5f9d0ca19 100644 --- a/Src/Merge.h +++ b/Src/Merge.h @@ -180,3 +180,13 @@ private: }; extern CMergeApp theApp; + +/** + * @brief Set flag so that application will broadcast notification at next + * idle time (via WM_TIMER id=IDLE_TIMER) + */ +inline void CMergeApp::SetNeedIdleTimer() +{ + m_bNeedIdleTimer = true; +} + diff --git a/Src/MergeDoc.cpp b/Src/MergeDoc.cpp index dbb14fc3b..a9cde07f2 100644 --- a/Src/MergeDoc.cpp +++ b/Src/MergeDoc.cpp @@ -3475,14 +3475,6 @@ void CMergeDoc::ClearSyncPoints() FlushAndRescan(true); } -/** - * @brief return true if there are synchronization points - */ -bool CMergeDoc::HasSyncPoints() -{ - return m_bHasSyncPoints; -} - std::vector > CMergeDoc::GetSyncPointList() { std::vector > list; diff --git a/Src/MergeDoc.h b/Src/MergeDoc.h index 9ad6d431b..765e2b7e0 100644 --- a/Src/MergeDoc.h +++ b/Src/MergeDoc.h @@ -393,3 +393,12 @@ private: String GetFileExt(LPCTSTR sFileName, LPCTSTR sDescription) const; void DoFileSave(int pane); }; + +/** + * @brief return true if there are synchronization points + */ +inline bool CMergeDoc::HasSyncPoints() +{ + return m_bHasSyncPoints; +} + diff --git a/Src/MergeEditView.cpp b/Src/MergeEditView.cpp index 6d2aeefee..3a94165e0 100644 --- a/Src/MergeEditView.cpp +++ b/Src/MergeEditView.cpp @@ -2337,16 +2337,6 @@ void CMergeEditView::OnRefresh() } /** - * @brief Enable/Disable automatic rescanning - */ -bool CMergeEditView::EnableRescan(bool bEnable) -{ - bool bOldValue = m_bAutomaticRescan; - m_bAutomaticRescan = bEnable; - return bOldValue; -} - -/** * @brief Handle some keys when in merging mode */ bool CMergeEditView::MergeModeKeyDown(MSG* pMsg) @@ -3770,15 +3760,6 @@ void CMergeEditView::OnViewSwapPanes() } /** - * @brief Check if cursor is inside difference. - * @return true if cursor is inside difference. - */ -bool CMergeEditView::IsCursorInDiff() const -{ - return m_bCurrentLineIsDiff; -} - -/** * @brief Determine if difference is visible on screen. * @param [in] nDiff Number of diff to check. * @return true if difference is visible. diff --git a/Src/MergeEditView.h b/Src/MergeEditView.h index 1d152cacf..e9963003b 100644 --- a/Src/MergeEditView.h +++ b/Src/MergeEditView.h @@ -351,3 +351,23 @@ protected: inline CMergeDoc* CMergeEditView::GetDocument() { return reinterpret_cast(m_pDocument); } #endif + +/** + * @brief Enable/Disable automatic rescanning + */ +inline bool CMergeEditView::EnableRescan(bool bEnable) +{ + bool bOldValue = m_bAutomaticRescan; + m_bAutomaticRescan = bEnable; + return bOldValue; +} + +/** + * @brief Check if cursor is inside difference. + * @return true if cursor is inside difference. + */ +inline bool CMergeEditView::IsCursorInDiff() const +{ + return m_bCurrentLineIsDiff; +} + diff --git a/Src/PatchDlg.cpp b/Src/PatchDlg.cpp index d308a6be1..8d23f489b 100644 --- a/Src/PatchDlg.cpp +++ b/Src/PatchDlg.cpp @@ -350,42 +350,6 @@ void CPatchDlg::OnDiffSwapFiles() } /** - * @brief Add patch item to internal list. - * @param [in] pf Patch item to add. - */ -void CPatchDlg::AddItem(const PATCHFILES& pf) -{ - m_fileList.push_back(pf); -} - -/** - * @brief Returns amount of patch items in the internal list. - * @return Count of patch items in the list. - */ -size_t CPatchDlg::GetItemCount() -{ - return m_fileList.size(); -} - -/** - * @brief Return item in the internal list at given position - * @param [in] position Zero-based index of item to get - * @return PATCHFILES from given position. - */ -const PATCHFILES& CPatchDlg::GetItemAt(size_t position) -{ - return m_fileList.at(position); -} - -/** - * @brief Empties internal item list. - */ -void CPatchDlg::ClearItems() -{ - m_fileList.clear(); -} - -/** * @brief Updates patch dialog settings from member variables. */ void CPatchDlg::UpdateSettings() diff --git a/Src/PatchDlg.h b/Src/PatchDlg.h index f96f2eacf..2da7166ea 100644 --- a/Src/PatchDlg.h +++ b/Src/PatchDlg.h @@ -103,3 +103,40 @@ protected: //}}AFX_MSG DECLARE_MESSAGE_MAP() }; + +/** + * @brief Add patch item to internal list. + * @param [in] pf Patch item to add. + */ +inline void CPatchDlg::AddItem(const PATCHFILES& pf) +{ + m_fileList.push_back(pf); +} + +/** + * @brief Returns amount of patch items in the internal list. + * @return Count of patch items in the list. + */ +inline size_t CPatchDlg::GetItemCount() +{ + return m_fileList.size(); +} + +/** + * @brief Return item in the internal list at given position + * @param [in] position Zero-based index of item to get + * @return PATCHFILES from given position. + */ +inline const PATCHFILES& CPatchDlg::GetItemAt(size_t position) +{ + return m_fileList.at(position); +} + +/** + * @brief Empties internal item list. + */ +inline void CPatchDlg::ClearItems() +{ + m_fileList.clear(); +} + diff --git a/Src/PathContext.cpp b/Src/PathContext.cpp index 76e3a3a23..5e9d62ecf 100644 --- a/Src/PathContext.cpp +++ b/Src/PathContext.cpp @@ -30,25 +30,6 @@ String PathInfo::GetPath(bool bNormalized /*= true*/) const return m_sPath; } -String& PathInfo::GetRef() -{ - return m_sPath; -} - -/** - * @brief Set path. - * @param [in] sPath New path for item. - */ -void PathInfo::SetPath(const TCHAR *sPath) -{ - m_sPath = sPath; -} - -void PathInfo::SetPath(const String & sPath) -{ - m_sPath = sPath; -} - /** * @brief Normalize path. */ @@ -114,32 +95,6 @@ void PathContext::SetAt(int nIndex, const String& newElement) m_path[nIndex].SetPath(newElement); } -String PathContext::operator[](int nIndex) const -{ - return GetAt(nIndex); -} - -String& PathContext::operator[](int nIndex) -{ - return GetElement(nIndex); -} - -/** - * @brief set number of files. - */ -void PathContext::SetSize(int nFiles) -{ - m_nFiles = nFiles; -} - -/** - * @brief Return number of files. - */ -int PathContext::GetSize() const -{ - return m_nFiles; -} - /** * @brief Empty m_path array */ @@ -262,13 +217,3 @@ void PathContext::Swap() else m_path[0].m_sPath.swap(m_path[2].m_sPath); } - -PathContextIterator PathContext::begin() const -{ - return PathContextIterator(this); -} - -PathContextIterator PathContext::end() const -{ - return PathContextIterator(); -} diff --git a/Src/PathContext.h b/Src/PathContext.h index 72feded2d..b0a3f1bcb 100644 --- a/Src/PathContext.h +++ b/Src/PathContext.h @@ -24,7 +24,7 @@ public: PathInfo(const PathInfo &pi); String GetPath(bool bNormalized = true) const; - String& GetRef(); + String& GetRef() { return m_sPath; } void SetPath(const TCHAR *path); void SetPath(const String & path); void NormalizePath(); @@ -34,6 +34,20 @@ private: }; /** + * @brief Set path. + * @param [in] sPath New path for item. + */ +inline void PathInfo::SetPath(const TCHAR *sPath) +{ + m_sPath = sPath; +} + +inline void PathInfo::SetPath(const String & sPath) +{ + m_sPath = sPath; +} + +/** * @brief Holds path information of compared files/directories. */ class PathContext @@ -51,8 +65,8 @@ public: String GetAt(int nIndex) const; String& GetElement(int nIndex); void SetAt(int nIndex, const String& newElement); - String operator[](int nIndex) const; - String& operator[](int nIndex); + String operator[](int nIndex) const { return GetAt(nIndex); } + String& operator[](int nIndex) { return GetElement(nIndex); } String GetLeft(bool bNormalized = true) const; String GetRight(bool bNormalized = true) const; @@ -74,6 +88,22 @@ private: PathInfo m_path[3]; /**< First, second, third path (left path at start) */ }; +/** + * @brief set number of files. + */ +inline void PathContext::SetSize(int nFiles) +{ + m_nFiles = nFiles; +} + +/** + * @brief Return number of files. + */ +inline int PathContext::GetSize() const +{ + return m_nFiles; +} + class PathContextIterator : public std::iterator { public: @@ -122,3 +152,13 @@ public: const PathContext *m_pPathContext; int m_sel; }; + +inline PathContextIterator PathContext::begin() const +{ + return PathContextIterator(this); +} + +inline PathContextIterator PathContext::end() const +{ + return PathContextIterator(); +} diff --git a/Src/ProjectFile.cpp b/Src/ProjectFile.cpp index 8beff244f..85a9d0370 100755 --- a/Src/ProjectFile.cpp +++ b/Src/ProjectFile.cpp @@ -168,50 +168,6 @@ const String ProjectFile::PROJECTFILE_EXT = toTString("WinMerge"); } /** - * @brief Returns if left path is defined in project file. - * @return true if project file has left path. - */ -bool ProjectFileItem::HasLeft() const -{ - return m_bHasLeft; -} - -/** - * @brief Returns if middle path is defined. - */ -bool ProjectFileItem::HasMiddle() const -{ - return m_bHasMiddle; -} - -/** - * @brief Returns if right path is defined in project file. - * @return true if project file has right path. - */ -bool ProjectFileItem::HasRight() const -{ - return m_bHasRight; -} - -/** - * @brief Returns if filter is defined in project file. - * @return true if project file has filter. - */ -bool ProjectFileItem::HasFilter() const -{ - return m_bHasFilter; -} - -/** - * @brief Returns if subfolder is defined in projectfile. - * @return true if project file has subfolder definition. - */ -bool ProjectFileItem::HasSubfolders() const -{ - return m_bHasSubfolders; -} - -/** * @brief Returns left path. * @param [out] pReadOnly true if readonly was specified for path. * @return Left path. @@ -224,15 +180,6 @@ String ProjectFileItem::GetLeft(bool * pReadOnly /*= nullptr*/) const } /** - * @brief Returns if left path is specified read-only. - * @return true if left path is read-only, false otherwise. - */ -bool ProjectFileItem::GetLeftReadOnly() const -{ - return m_bLeftReadOnly; -} - -/** * @brief Set left path, returns old left path. * @param [in] sLeft Left path. * @param [in] bReadOnly Will path be recorded read-only? @@ -256,14 +203,6 @@ String ProjectFileItem::GetMiddle(bool * pReadOnly /*= nullptr*/) const } /** - * @brief Returns if middle path is specified read-only. - */ -bool ProjectFileItem::GetMiddleReadOnly() const -{ - return m_bMiddleReadOnly; -} - -/** * @brief Set middle path, returns old middle path. * @param [in] sMiddle Middle path. * @param [in] bReadOnly Will path be recorded read-only? @@ -290,15 +229,6 @@ String ProjectFileItem::GetRight(bool * pReadOnly /*= nullptr*/) const } /** - * @brief Returns if right path is specified read-only. - * @return true if right path is read-only, false otherwise. - */ -bool ProjectFileItem::GetRightReadOnly() const -{ - return m_bRightReadOnly; -} - -/** * @brief Set right path, returns old right path. * @param [in] sRight Right path. * @param [in] bReadOnly Will path be recorded read-only? @@ -311,54 +241,6 @@ void ProjectFileItem::SetRight(const String& sRight, const bool * pReadOnly /*= } /** - * @brief Returns filter. - * @return Filter string. - */ -String ProjectFileItem::GetFilter() const -{ - return m_filter; -} - -/** - * @brief Set filter. - * @param [in] sFilter New filter string to set. - */ -void ProjectFileItem::SetFilter(const String& sFilter) -{ - m_filter = sFilter; -} - -/** - * @brief Returns subfolder included -setting. - * @return != 0 if subfolders are included. - */ -int ProjectFileItem::GetSubfolders() const -{ - return m_subfolders; -} - -/** - * @brief set subfolder. - * @param [in] iSubfolder New value for subfolder inclusion. - */ -void ProjectFileItem::SetSubfolders(bool bSubfolder) -{ - m_subfolders = bSubfolder ? 1 : 0; -} - -/** - * @brief - * - * @param [in] files Files in project - * @param [in] bSubFolders If true subfolders included (recursive compare) - */ -void ProjectFileItem::SetPaths(const PathContext& files, bool bSubfolders) -{ - m_paths = files; - m_subfolders = bSubfolders; -} - -/** * @brief Returns left and right paths and recursive from project file * * @param [out] files Files in project diff --git a/Src/ProjectFile.h b/Src/ProjectFile.h index 73b5b1551..dcdac1a15 100755 --- a/Src/ProjectFile.h +++ b/Src/ProjectFile.h @@ -86,3 +86,122 @@ public: private: std::list m_items; }; + +/** + * @brief Returns if left path is defined in project file. + * @return true if project file has left path. + */ +inline bool ProjectFileItem::HasLeft() const +{ + return m_bHasLeft; +} + +/** + * @brief Returns if middle path is defined. + */ +inline bool ProjectFileItem::HasMiddle() const +{ + return m_bHasMiddle; +} + +/** + * @brief Returns if right path is defined in project file. + * @return true if project file has right path. + */ +inline bool ProjectFileItem::HasRight() const +{ + return m_bHasRight; +} + +/** + * @brief Returns if filter is defined in project file. + * @return true if project file has filter. + */ +inline bool ProjectFileItem::HasFilter() const +{ + return m_bHasFilter; +} + +/** + * @brief Returns if subfolder is defined in projectfile. + * @return true if project file has subfolder definition. + */ +inline bool ProjectFileItem::HasSubfolders() const +{ + return m_bHasSubfolders; +} + +/** + * @brief Returns if left path is specified read-only. + * @return true if left path is read-only, false otherwise. + */ +inline bool ProjectFileItem::GetLeftReadOnly() const +{ + return m_bLeftReadOnly; +} + +/** + * @brief Returns if middle path is specified read-only. + */ +inline bool ProjectFileItem::GetMiddleReadOnly() const +{ + return m_bMiddleReadOnly; +} + +/** + * @brief Returns if right path is specified read-only. + * @return true if right path is read-only, false otherwise. + */ +inline bool ProjectFileItem::GetRightReadOnly() const +{ + return m_bRightReadOnly; +} + +/** + * @brief Returns filter. + * @return Filter string. + */ +inline String ProjectFileItem::GetFilter() const +{ + return m_filter; +} + +/** + * @brief Set filter. + * @param [in] sFilter New filter string to set. + */ +inline void ProjectFileItem::SetFilter(const String& sFilter) +{ + m_filter = sFilter; +} + +/** + * @brief Returns subfolder included -setting. + * @return != 0 if subfolders are included. + */ +inline int ProjectFileItem::GetSubfolders() const +{ + return m_subfolders; +} + +/** + * @brief set subfolder. + * @param [in] iSubfolder New value for subfolder inclusion. + */ +inline void ProjectFileItem::SetSubfolders(bool bSubfolder) +{ + m_subfolders = bSubfolder ? 1 : 0; +} + +/** + * @brief + * + * @param [in] files Files in project + * @param [in] bSubFolders If true subfolders included (recursive compare) + */ +inline void ProjectFileItem::SetPaths(const PathContext& files, bool bSubfolders) +{ + m_paths = files; + m_subfolders = bSubfolders; +} + -- 2.11.0