]>
git.saurik.com Git - wxWidgets.git/blob - contrib/src/stc/scintilla/include/PropSet.h
1 // Scintilla source code edit control
3 ** A Java style properties file module.
5 // Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
6 // The License.txt file describes the conditions under which this software may be distributed.
12 bool EqualCaseInsensitive(const char *a
, const char *b
);
14 bool isprefix(const char *target
, const char *prefix
);
21 Property() : hash(0), key(0), val(0), next(0) {}
28 enum { hashRoots
=31 };
29 Property
*props
[hashRoots
];
36 void Set(const char *key
, const char *val
, int lenKey
=-1, int lenVal
=-1);
37 void Set(const char *keyVal
);
38 void SetMultiple(const char *s
);
39 SString
Get(const char *key
);
40 SString
GetExpanded(const char *key
);
41 SString
Expand(const char *withVars
, int maxExpands
=100);
42 int GetInt(const char *key
, int defaultValue
=0);
43 SString
GetWild(const char *keybase
, const char *filename
);
44 SString
GetNewExpand(const char *keybase
, const char *filename
="");
46 char *ToString(); // Caller must delete[] the return value
47 bool GetFirst(char **key
, char **val
);
48 bool GetNext(char **key
, char **val
);
55 // Each word contains at least one character - a empty word acts as sentinel at the end.
60 bool onlyLineEnds
; ///< Delimited by any white space or only line ends
63 WordList(bool onlyLineEnds_
= false) :
64 words(0), wordsNoCase(0), list(0), len(0), onlyLineEnds(onlyLineEnds_
), sorted(false) {}
65 ~WordList() { Clear(); }
66 operator bool() { return len
? true : false; }
67 char *operator[](int ind
) { return words
[ind
]; }
69 void Set(const char *s
);
70 char *Allocate(int size
);
71 void SetFromAllocated();
72 bool InList(const char *s
);
73 const char *GetNearestWord(const char *wordStart
, int searchLen
= -1,
74 bool ignoreCase
= false, SString wordCharacters
="");
75 char *GetNearestWords(const char *wordStart
, int searchLen
=-1,
76 bool ignoreCase
=false, char otherSeparator
='\0');
79 inline bool IsAlphabetic(unsigned int ch
) {
80 return ((ch
>= 'A') && (ch
<= 'Z')) || ((ch
>= 'a') && (ch
<= 'z'));