WordList.h 1021 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. #ifndef WORDLIST_H
  8. #define WORDLIST_H
  9. #ifdef SCI_NAMESPACE
  10. namespace Scintilla {
  11. #endif
  12. /**
  13. */
  14. class WordList {
  15. // Each word contains at least one character - a empty word acts as sentinel at the end.
  16. char **words;
  17. char *list;
  18. int len;
  19. bool onlyLineEnds; ///< Delimited by any white space or only line ends
  20. int starts[256];
  21. public:
  22. explicit WordList(bool onlyLineEnds_ = false);
  23. ~WordList();
  24. operator bool() const;
  25. bool operator!=(const WordList &other) const;
  26. int Length() const;
  27. void Clear();
  28. void Set(const char *s);
  29. bool InList(const char *s) const;
  30. bool InListAbbreviated(const char *s, const char marker) const;
  31. bool InListAbridged(const char *s, const char marker) const;
  32. const char *WordAt(int n) const;
  33. };
  34. #ifdef SCI_NAMESPACE
  35. }
  36. #endif
  37. #endif