aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2003-07-31 12:58:39 +0000
committernyamatongwe <devnull@localhost>2003-07-31 12:58:39 +0000
commitb841b896f71331de42e7632aede6e3c41af739f5 (patch)
tree125028014464f9550482342f13c0ea2b591c742f
parentbf99497d8adc2c66e349bc414de005896e555624 (diff)
downloadscintilla-mirror-b841b896f71331de42e7632aede6e3c41af739f5.tar.gz
Made some of PropSet protected so it can be overridden.
-rw-r--r--include/PropSet.h18
-rw-r--r--src/PropSet.cxx12
2 files changed, 15 insertions, 15 deletions
diff --git a/include/PropSet.h b/include/PropSet.h
index b32082491..20ac5f774 100644
--- a/include/PropSet.h
+++ b/include/PropSet.h
@@ -24,11 +24,21 @@ struct Property {
/**
*/
class PropSet {
-private:
+protected:
enum { hashRoots=31 };
Property *props[hashRoots];
Property *enumnext;
int enumhash;
+ static unsigned int HashString(const char *s, size_t len) {
+ unsigned int ret = 0;
+ while (len--) {
+ ret <<= 4;
+ ret ^= *s;
+ s++;
+ }
+ return ret;
+ }
+ static bool IncludesVar(const char *value, const char *key);
public:
PropSet *superPS;
PropSet();
@@ -60,7 +70,7 @@ public:
bool onlyLineEnds; ///< Delimited by any white space or only line ends
bool sorted;
int starts[256];
- WordList(bool onlyLineEnds_ = false) :
+ WordList(bool onlyLineEnds_ = false) :
words(0), wordsNoCase(0), list(0), len(0), onlyLineEnds(onlyLineEnds_), sorted(false) {}
~WordList() { Clear(); }
operator bool() { return len ? true : false; }
@@ -70,9 +80,9 @@ public:
char *Allocate(int size);
void SetFromAllocated();
bool InList(const char *s);
- const char *GetNearestWord(const char *wordStart, int searchLen = -1,
+ const char *GetNearestWord(const char *wordStart, int searchLen = -1,
bool ignoreCase = false, SString wordCharacters="");
- char *GetNearestWords(const char *wordStart, int searchLen=-1,
+ char *GetNearestWords(const char *wordStart, int searchLen=-1,
bool ignoreCase=false, char otherSeparator='\0');
};
diff --git a/src/PropSet.cxx b/src/PropSet.cxx
index 8455d854d..021a65727 100644
--- a/src/PropSet.cxx
+++ b/src/PropSet.cxx
@@ -71,16 +71,6 @@ bool EqualCaseInsensitive(const char *a, const char *b) {
return 0 == CompareCaseInsensitive(a, b);
}
-inline unsigned int HashString(const char *s, size_t len) {
- unsigned int ret = 0;
- while (len--) {
- ret <<= 4;
- ret ^= *s;
- s++;
- }
- return ret;
-}
-
PropSet::PropSet() {
superPS = 0;
for (int root = 0; root < hashRoots; root++)
@@ -160,7 +150,7 @@ SString PropSet::Get(const char *key) {
}
}
-static bool IncludesVar(const char *value, const char *key) {
+bool PropSet::IncludesVar(const char *value, const char *key) {
const char *var = strstr(value, "$(");
while (var) {
if (isprefix(var + 2, key) && (var[2 + strlen(key)] == ')')) {