OSDN Git Service

Fix untranslated strings
[winmerge-jp/winmerge-jp.git] / Src / FilterCommentsManager.h
1 /////////////////////////////////////////////////////////////////////////////\r
2 //    License (GPLv2+):\r
3 //    This program is free software; you can redistribute it and/or modify\r
4 //    it under the terms of the GNU General Public License as published by\r
5 //    the Free Software Foundation; either version 2 of the License, or (at\r
6 //    your option) any later version.\r
7 //    \r
8 //    This program is distributed in the hope that it will be useful, but\r
9 //    WITHOUT ANY WARRANTY; without even the implied warranty of\r
10 //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
11 //    GNU General Public License for more details.\r
12 //\r
13 //    You should have received a copy of the GNU General Public License\r
14 //    along with this program; if not, write to the Free Software\r
15 //    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
16 /////////////////////////////////////////////////////////////////////////////\r
17 /** \r
18  * @file  FilterCommentsManager.h\r
19  *\r
20  * @brief FilterCommentsManager class declaration.\r
21  */\r
22 #pragma once\r
23 \r
24 #include <string>\r
25 #include <map>\r
26 #include "UnicodeString.h"\r
27 \r
28 //IngnoreComment logic developed by David Maisonave AKA (Axter)\r
29 /**\r
30 @struct FilterCommentsSet\r
31 @brief FilterCommentsSet holds search strings used to find comments in compared files.\r
32                 This data is used to find blocks that can be ignored when comparing to files.\r
33 @note\r
34                 The ignore-comment logic can only use ANSI strings, because the search buffer is\r
35                 char* type.\r
36                 Therefore, the data members should not be replaced with String type, and should\r
37                 remain std::string, or other non-unicode type string.\r
38 */\r
39 struct FilterCommentsSet\r
40 {\r
41         std::string StartMarker;\r
42         std::string EndMarker;\r
43         std::string InlineMarker;\r
44 };\r
45 \r
46 /**\r
47 @class FilterCommentsManager\r
48 @brief FilterCommentsManager reads language comment start and end marker strings from\r
49                 an INI file, and stores it in the map member variable m_FilterCommentsSetByFileType.\r
50                 Each set of comment markers have a list of file types that can be used with\r
51                 the file markers.\r
52 @note\r
53 The ignore-comment logic can only use ANSI strings, because the search buffer is\r
54 char* type.\r
55 FilterCommentsManager uses _T logic, only so-as to allow UNICODE file names to be \r
56 used for the INI file, or INI file base directory.\r
57 After retrieving data from INI file, the data is converted to ANSI.\r
58 If no INI file exist, or the INI file is empty, then a default INI file is \r
59 created with default values that are assoicated with most commen languages.\r
60 */\r
61 class FilterCommentsManager\r
62 {\r
63 public:\r
64         explicit FilterCommentsManager(const String &IniFileName = _T(""));\r
65         FilterCommentsSet GetSetForFileType(const String& FileTypeName) const;\r
66 \r
67 private:\r
68         FilterCommentsManager(const FilterCommentsManager&); //Don't allow copy\r
69         FilterCommentsManager& operator=(const FilterCommentsManager&);//Don't allow assignment\r
70         void CreateDefaultMarkers();\r
71         void Load();\r
72 \r
73         //Use CString instead of std::string, so as to allow UNICODE file extensions\r
74         std::map<String, FilterCommentsSet> m_FilterCommentsSetByFileType;\r
75         String m_IniFileName;\r
76 };\r