1 // Scintilla source code edit control
\r
3 ** A Java style properties file module.
\r
5 // Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
\r
6 // The License.txt file describes the conditions under which this software may be distributed.
\r
10 #include "SString.h"
\r
12 bool EqualCaseInsensitive(const char *a, const char *b);
\r
14 bool isprefix(const char *target, const char *prefix);
\r
16 #ifdef SCI_NAMESPACE
\r
17 namespace Scintilla {
\r
25 Property() : hash(0), key(0), val(0), next(0) {}
\r
32 enum { hashRoots=31 };
\r
33 Property *props[hashRoots];
\r
36 static unsigned int HashString(const char *s, size_t len) {
\r
37 unsigned int ret = 0;
\r
50 void Set(const char *key, const char *val, int lenKey=-1, int lenVal=-1);
\r
51 void Set(const char *keyVal);
\r
52 void Unset(const char *key, int lenKey=-1);
\r
53 void SetMultiple(const char *s);
\r
54 SString Get(const char *key) const;
\r
55 SString GetExpanded(const char *key) const;
\r
56 SString Expand(const char *withVars, int maxExpands=100) const;
\r
57 int GetInt(const char *key, int defaultValue=0) const;
\r
59 char *ToString() const; // Caller must delete[] the return value
\r
62 // copy-value semantics not implemented
\r
63 PropSet(const PropSet ©);
\r
64 void operator=(const PropSet &assign);
\r
71 // Each word contains at least one character - a empty word acts as sentinel at the end.
\r
75 bool onlyLineEnds; ///< Delimited by any white space or only line ends
\r
78 WordList(bool onlyLineEnds_ = false) :
\r
79 words(0), list(0), len(0), onlyLineEnds(onlyLineEnds_),
\r
82 ~WordList() { Clear(); }
\r
83 operator bool() { return len ? true : false; }
\r
85 void Set(const char *s);
\r
86 bool InList(const char *s);
\r
87 bool InListAbbreviated(const char *s, const char marker);
\r
90 inline bool IsAlphabetic(unsigned int ch) {
\r
91 return ((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z'));
\r
94 #ifdef SCI_NAMESPACE
\r
99 // Visual C++ doesn't like the private copy idiom for disabling
\r
100 // the default copy constructor and operator=, but it's fine.
\r
101 #pragma warning(disable: 4511 4512)
\r