OSDN Git Service

autoit.cpp - Macros >> User 1 ..... Variable >> User 2 (#749) (2)
[winmerge-jp/winmerge-jp.git] / Src / FileFilterHelper.h
index 70fd958..56bbe04 100644 (file)
@@ -1,32 +1,13 @@
-/////////////////////////////////////////////////////////////////////////////
-//    License (GPLv2+):
-//    This program is free software; you can redistribute it and/or modify
-//    it under the terms of the GNU General Public License as published by
-//    the Free Software Foundation; either version 2 of the License, or
-//    (at your option) any later version.
-//
-//    This program is distributed in the hope that it will be useful, but
-//    WITHOUT ANY WARRANTY; without even the implied warranty of
-//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//    General Public License for more details.
-//
-//    You should have received a copy of the GNU General Public License
-//    along with this program; if not, write to the Free Software
-//    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-/////////////////////////////////////////////////////////////////////////////
+// SPDX-License-Identifier: GPL-2.0-or-later
 /** 
  * @file  FileFilterHelper.h
  *
  * @brief Declaration file for FileFilterHelper
  */
-// ID line follows -- this is updated by SVN
-// $Id: FileFilterHelper.h 7024 2009-10-22 18:26:45Z kimmov $
-
-#ifndef _FILEFILTERHELPER_H_
-#define _FILEFILTERHELPER_H_
+#pragma once
 
 #include <vector>
-#include <boost/scoped_ptr.hpp>
+#include <memory>
 #include "UnicodeString.h"
 #include "DirItem.h"
 
@@ -130,7 +111,7 @@ public:
 
        FileFilterMgr * GetManager() const;
        void SetFileFilterPath(const String& szFileFilterPath);
-       void GetFileFilters(std::vector<FileFilterInfo> * filters, String & selected) const;
+       std::vector<FileFilterInfo> GetFileFilters(String & selected) const;
        String GetFileFilterName(const String& filterPath) const;
        String GetFileFilterPath(const String& filterName) const;
        void SetUserFilterPath(const String & filterPath);
@@ -147,21 +128,36 @@ public:
        String GetFilterNameOrMask() const;
        bool SetFilter(const String &filter);
 
-       bool includeFile(const String& szFileName) const;
-       bool includeDir(const String& szDirName) const;
+       bool includeFile(const String& szFileName) const override;
+       bool includeDir(const String& szDirName) const override;
 
 protected:
        String ParseExtensions(const String &extensions) const;
 
 private:
-       boost::scoped_ptr<FilterList> m_pMaskFilter;       /*< Filter for filemasks (*.cpp) */
+       std::unique_ptr<FilterList> m_pMaskFilter;       /*< Filter for filemasks (*.cpp) */
        FileFilter * m_currentFilter;     /*< Currently selected filefilter */
-       boost::scoped_ptr<FileFilterMgr> m_fileFilterMgr;  /*< Associated FileFilterMgr */
+       std::unique_ptr<FileFilterMgr> m_fileFilterMgr;  /*< Associated FileFilterMgr */
        String m_sFileFilterPath;        /*< Path to current filter */
        String m_sMask;   /*< File mask (if defined) "*.cpp *.h" etc */
-       bool m_bUseMask;   /*< If TRUE file mask is used, filter otherwise */
+       bool m_bUseMask;   /*< If `true` file mask is used, filter otherwise */
        String m_sGlobalFilterPath;    /*< Path for shared filters */
        String m_sUserSelFilterPath;     /*< Path for user's private filters */
 };
 
-#endif // _FILEFILTERHELPER_H_
+/**
+ * @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;
+}
+