diff options
| -rw-r--r-- | include/PropSet.h | 18 | ||||
| -rw-r--r-- | src/PropSet.cxx | 12 | 
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)] == ')')) { | 
