aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2000-08-31 13:37:11 +0000
committernyamatongwe <devnull@localhost>2000-08-31 13:37:11 +0000
commit47217769b30c613d6772c9c992c69e250c6c6d5c (patch)
tree88bc3f11ae21230b352970c3bf8a35ba9b8e9dff /include
parent90f82072df218491195da41326ae24830156844a (diff)
downloadscintilla-mirror-47217769b30c613d6772c9c992c69e250c6c6d5c.tar.gz
Changes from Ferda to put the sorting and searching here rather than in
SciTEBase.
Diffstat (limited to 'include')
-rw-r--r--include/PropSet.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/PropSet.h b/include/PropSet.h
index a5473915c..9766aa861 100644
--- a/include/PropSet.h
+++ b/include/PropSet.h
@@ -8,6 +8,11 @@
bool EqualCaseInsensitive(const char *a, const char *b);
+#if PLAT_WIN
+#define strcasecmp stricmp
+#define strncasecmp strnicmp
+#endif
+
// Define another string class.
// While it would be 'better' to use std::string, that doubles the executable size.
@@ -207,13 +212,14 @@ class WordList {
public:
// Each word contains at least one character - a empty word acts as sentinal at the end.
char **words;
+ char **wordsNoCase;
char *list;
int len;
bool onlyLineEnds; // Delimited by any white space or only line ends
bool sorted;
int starts[256];
WordList(bool onlyLineEnds_ = false) :
- words(0), list(0), len(0), onlyLineEnds(onlyLineEnds_), sorted(false) {}
+ words(0), wordsNoCase(0), list(0), len(0), onlyLineEnds(onlyLineEnds_), sorted(false) {}
~WordList() { Clear(); }
operator bool() { return words ? true : false; }
const char *operator[](int ind) { return words[ind]; }
@@ -222,6 +228,12 @@ public:
char *Allocate(int size);
void SetFromAllocated();
bool InList(const char *s);
+ const char *GetNearestWord(const char *wordStart, int searchLen = -1, bool ignoreCase = false);
+ char *GetNearestWords(const char *wordStart, int searchLen = -1, bool ignoreCase = false);
};
+inline bool nonFuncChar(char ch) {
+ return strchr("\t\n\r !\"#$%&'()*+,-./:;<=>?@[\\]^`{|}~", ch) != NULL;
+}
+
#endif