]>
git.saurik.com Git - wxWidgets.git/blob - 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
];
32 static unsigned int HashString(const char *s
, size_t len
) {
41 static bool IncludesVar(const char *value
, const char *key
);
47 void Set(const char *key
, const char *val
, int lenKey
=-1, int lenVal
=-1);
48 void Set(const char *keyVal
);
49 void Unset(const char *key
, int lenKey
=-1);
50 void SetMultiple(const char *s
);
51 SString
Get(const char *key
);
52 SString
GetExpanded(const char *key
);
53 SString
Expand(const char *withVars
, int maxExpands
=100);
54 int GetInt(const char *key
, int defaultValue
=0);
55 SString
GetWild(const char *keybase
, const char *filename
);
56 SString
GetNewExpand(const char *keybase
, const char *filename
="");
58 char *ToString(); // Caller must delete[] the return value
59 bool GetFirst(char **key
, char **val
);
60 bool GetNext(char **key
, char **val
);
63 // copy-value semantics not implemented
64 PropSet(const PropSet
©
);
65 void operator=(const PropSet
&assign
);
72 // Each word contains at least one character - a empty word acts as sentinel at the end.
77 bool onlyLineEnds
; ///< Delimited by any white space or only line ends
80 WordList(bool onlyLineEnds_
= false) :
81 words(0), wordsNoCase(0), list(0), len(0), onlyLineEnds(onlyLineEnds_
), sorted(false) {}
82 ~WordList() { Clear(); }
83 operator bool() { return len
? true : false; }
84 char *operator[](int ind
) { return words
[ind
]; }
86 void Set(const char *s
);
87 char *Allocate(int size
);
88 void SetFromAllocated();
89 bool InList(const char *s
);
90 const char *GetNearestWord(const char *wordStart
, int searchLen
,
91 bool ignoreCase
= false, SString wordCharacters
="", int wordIndex
= -1);
92 char *GetNearestWords(const char *wordStart
, int searchLen
,
93 bool ignoreCase
=false, char otherSeparator
='\0', bool exactLen
=false);
96 inline bool IsAlphabetic(unsigned int ch
) {
97 return ((ch
>= 'A') && (ch
<= 'Z')) || ((ch
>= 'a') && (ch
<= 'z'));
102 // Visual C++ doesn't like the private copy idiom for disabling
103 // the default copy constructor and operator=, but it's fine.
104 #pragma warning(disable: 4511 4512)