1 // Scintilla source code edit control 2 /** @file WordList.h 3 ** Hold a list of words. 4 **/ 5 // Copyright 1998-2010 by Neil Hodgson <[email protected]> 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 namespace Scintilla { 12 13 /** 14 */ 15 class WordList { 16 // Each word contains at least one character - a empty word acts as sentinel at the end. 17 char **words; 18 char *list; 19 int len; 20 bool onlyLineEnds; ///< Delimited by any white space or only line ends 21 int starts[256]; 22 public: 23 explicit WordList(bool onlyLineEnds_ = false); 24 ~WordList(); 25 operator bool() const noexcept; 26 bool operator!=(const WordList &other) const noexcept; 27 int Length() const noexcept; 28 void Clear() noexcept; 29 bool Set(const char *s); 30 bool InList(const char *s) const noexcept; 31 bool InListAbbreviated(const char *s, const char marker) const noexcept; 32 bool InListAbridged(const char *s, const char marker) const noexcept; 33 const char *WordAt(int n) const noexcept; 34 }; 35 36 } 37 38 #endif 39