OSDN Git Service

Plugins: Fix a crash on Window XP
[winmerge-jp/winmerge-jp.git] / Src / DiffTextBuffer.h
index ad8ff78..eb8283b 100644 (file)
@@ -22,7 +22,8 @@ private :
        CMergeDoc * m_pOwnerDoc; /**< Merge document owning this buffer. */
        int m_nThisPane; /**< Left/Right side */
        String m_strTempPath; /**< Temporary files folder. */
-       int m_unpackerSubcode; /**< Plugin information. */
+       String m_strTempFileName; /**< Temporary file name. */
+       std::vector<int> m_unpackerSubcodes; /**< Plugin information. */
        bool m_bMixedEOL; /**< EOL style of this buffer is mixed? */
 
        /** 
@@ -42,6 +43,7 @@ public :
        CDiffTextBuffer(CMergeDoc * pDoc, int pane);
 
        void SetTempPath(const String &path);
+       String GetTempFileName() const { return m_strTempFileName; }
        virtual void AddUndoRecord (bool bInsert, const CPoint & ptStartPos,
                const CPoint & ptEndPos, LPCTSTR pszText, size_t cchText,
                int nActionType = CE_ACTION_UNKNOWN,
@@ -49,11 +51,11 @@ public :
        bool curUndoGroup();
        void ReplaceFullLines(CDiffTextBuffer& dbuf, CDiffTextBuffer& sbuf, CCrystalTextView * pSource, int nLineBegin, int nLineEnd, int nAction =CE_ACTION_UNKNOWN);
 
-       int LoadFromFile(LPCTSTR pszFileName, PackingInfo * infoUnpacker,
+       int LoadFromFile(LPCTSTR pszFileName, PackingInfo& infoUnpacker,
                LPCTSTR filteredFilenames, bool & readOnly, CRLFSTYLE nCrlfStyle,
                const FileTextEncoding & encoding, CString &sError);
        int SaveToFile (const String& pszFileName, bool bTempFile, String & sError,
-               PackingInfo * infoUnpacker = nullptr, CRLFSTYLE nCrlfStyle = CRLF_STYLE_AUTOMATIC,
+               PackingInfo& infoUnpacker, CRLFSTYLE nCrlfStyle = CRLFSTYLE::AUTOMATIC,
                bool bClearModifiedFlag = true, int nStartLine = 0, int nLines = -1);
        ucr::UNICODESET getUnicoding() const { return m_encoding.m_unicoding; }
        void setUnicoding(ucr::UNICODESET value) { m_encoding.m_unicoding = value; }
@@ -80,3 +82,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;
+}
+