1 // Scintilla source code edit control
2 /** @file WordList.h
3  ** Hold a list of words.
4  **/
5 // Copyright 1998-2010 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
7 
8 #ifndef WORDLIST_H
9 #define WORDLIST_H
10 
11 #ifdef SCI_NAMESPACE
12 namespace Scintilla {
13 #endif
14 
15 /**
16  */
17 class WordList {
18 public:
19 	// Each word contains at least one character - a empty word acts as sentinel at the end.
20 	char **words;
21 	char *list;
22 	int len;
23 	bool onlyLineEnds;	///< Delimited by any white space or only line ends
24 	int starts[256];
25 	WordList(bool onlyLineEnds_ = false) :
26 		words(0), list(0), len(0), onlyLineEnds(onlyLineEnds_)
27 		{}
~WordList()28 	~WordList() { Clear(); }
29 	operator bool() const { return len ? true : false; }
30 	bool operator!=(const WordList &other) const;
31 	void Clear();
32 	void Set(const char *s);
33 	bool InList(const char *s) const;
34 	bool InListAbbreviated(const char *s, const char marker) const;
35 };
36 
37 #ifdef SCI_NAMESPACE
38 }
39 #endif
40 
41 #endif
42