Merge branch 'scintilla-551'
[TortoiseGit.git] / src / Utils / PersonalDictionary.h
bloba87a5b97ac24b86e34877c2b2b60e3f5c5e94690
1 // TortoiseGit - a Windows shell extension for easy version control
3 // Copyright (C) 2023 - TortoiseGit
4 // Copyright (C) 2003-2007 - TortoiseSVN
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #pragma once
21 #include <set>
23 #define PDICT_MAX_WORD_LENGTH 50
25 /**
26 * \ingroup Utils
27 * Utility class for handling a dictionary with custom words.
29 class CPersonalDictionary
31 public:
32 CPersonalDictionary(LONG lLanguage = 0);
33 ~CPersonalDictionary();
35 public:
36 bool AddWord(const CString& sWord);
37 bool FindWord(const CString& sWord);
38 bool Save();
39 void Init(LONG lLanguage = 0) {m_lLanguage = lLanguage;}
40 private:
41 bool Load();
42 private:
43 LONG m_lLanguage = 0;
44 bool m_bLoaded = false;
45 std::set<CString> dict;