OSDN Git Service

Remove unused declarations
[winmerge-jp/winmerge-jp.git] / Src / FileFilterMgr.h
index 10ee1d7..88d1b35 100644 (file)
@@ -1,17 +1,4 @@
-/////////////////////////////////////////////////////////////////////////////
-//    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 FileFilterMgr.h
  *
@@ -56,8 +43,6 @@ public:
        // Reload an edited filter
        int ReloadFilterFromDisk(FileFilter * pfilter);
        int ReloadFilterFromDisk(const String& szFullPath);
-       // Load a filter from a string
-       void LoadFilterString(const String& szFilterString);
        int AddFilter(const String& szFilterFile);
        void RemoveFilter(const String& szFilterFile);
 
@@ -69,6 +54,7 @@ public:
        String GetFilterDesc(int i) const;
        String GetFilterDesc(const FileFilter *pFilter) const;
        FileFilter * GetFilterByPath(const String& szFilterName);
+       FileFilter * GetFilterByIndex(int i);
        String GetFullpath(FileFilter * pfilter) const;
 
        // methods to actually use filter
@@ -76,6 +62,7 @@ public:
        bool TestDirNameAgainstFilter(const FileFilter * pFilter, const String& szDirName) const;
 
        void DeleteAllFilters();
+       void CloneFrom(const FileFilterMgr* fileFilterMgr);
 
 // Implementation methods
 protected:
@@ -90,4 +77,67 @@ private:
 
 
 bool TestAgainstRegList(const std::vector<FileFilterElementPtr> *filterList, const String& szTest);
-void EmptyFilterList(std::vector<FileFilterElementPtr> *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;
+}