~ubuntu-branches/ubuntu/raring/geany/raring-proposed

« back to all changes in this revision

Viewing changes to scintilla/include/PropSet.h

  • Committer: Bazaar Package Importer
  • Author(s): Damián Viano
  • Date: 2008-05-02 11:37:45 UTC
  • mfrom: (1.2.1 upstream) (9 hardy)
  • mto: (3.2.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: james.westby@ubuntu.com-20080502113745-xzp4g6dmovrpoj17
Tags: 0.14-1
New upstream release (Closes: #478126)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// Scintilla source code edit control
 
1
/* Scintilla source code edit control */
2
2
/** @file PropSet.h
3
3
 ** A Java style properties file module.
4
4
 **/
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.
 
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. */
7
7
 
8
8
#ifndef PROPSET_H
9
9
#define PROPSET_H
13
13
 
14
14
bool isprefix(const char *target, const char *prefix);
15
15
 
 
16
#ifdef SCI_NAMESPACE
 
17
namespace Scintilla {
 
18
#endif
 
19
 
16
20
struct Property {
17
21
        unsigned int hash;
18
22
        char *key;
29
33
        Property *props[hashRoots];
30
34
        Property *enumnext;
31
35
        int enumhash;
32
 
        static bool caseSensitiveFilenames;
33
36
        static unsigned int HashString(const char *s, size_t len) {
34
37
                unsigned int ret = 0;
35
38
                while (len--) {
39
42
                }
40
43
                return ret;
41
44
        }
42
 
        static bool IncludesVar(const char *value, const char *key);
43
45
 
44
46
public:
45
47
        PropSet *superPS;
49
51
        void Set(const char *keyVal);
50
52
        void Unset(const char *key, int lenKey=-1);
51
53
        void SetMultiple(const char *s);
52
 
        SString Get(const char *key);
53
 
        SString GetExpanded(const char *key);
54
 
        SString Expand(const char *withVars, int maxExpands=100);
55
 
        int GetInt(const char *key, int defaultValue=0);
56
 
        SString GetWild(const char *keybase, const char *filename);
57
 
        SString GetNewExpand(const char *keybase, const char *filename="");
 
54
        SString Get(const char *key) const;
 
55
        SString GetExpanded(const char *key) const;
 
56
        SString Expand(const char *withVars, int maxExpands=100) const;
 
57
        int GetInt(const char *key, int defaultValue=0) const;
58
58
        void Clear();
59
 
        char *ToString();       // Caller must delete[] the return value
60
 
        bool GetFirst(char **key, char **val);
61
 
        bool GetNext(char **key, char **val);
62
 
        static void SetCaseSensitiveFilenames(bool caseSensitiveFilenames_) {
63
 
                caseSensitiveFilenames = caseSensitiveFilenames_;
64
 
        }
 
59
        char *ToString() const; /* Caller must delete[] the return value */
65
60
 
66
61
private:
67
 
        // copy-value semantics not implemented
 
62
        /* copy-value semantics not implemented */
68
63
        PropSet(const PropSet &copy);
69
64
        void operator=(const PropSet &assign);
70
65
};
73
68
 */
74
69
class WordList {
75
70
public:
76
 
        // Each word contains at least one character - a empty word acts as sentinel at the end.
 
71
        /* Each word contains at least one character - a empty word acts as sentinel at the end. */
77
72
        char **words;
78
 
        char **wordsNoCase;
79
73
        char *list;
80
74
        int len;
81
 
        bool onlyLineEnds;      ///< Delimited by any white space or only line ends
 
75
        bool onlyLineEnds;      /**< Delimited by any white space or only line ends */
82
76
        bool sorted;
83
 
        bool sortedNoCase;
84
77
        int starts[256];
85
78
        WordList(bool onlyLineEnds_ = false) :
86
 
                words(0), wordsNoCase(0), list(0), len(0), onlyLineEnds(onlyLineEnds_),
87
 
                sorted(false), sortedNoCase(false) {}
 
79
                words(0), list(0), len(0), onlyLineEnds(onlyLineEnds_),
 
80
                sorted(false)
 
81
                {}
88
82
        ~WordList() { Clear(); }
89
83
        operator bool() { return len ? true : false; }
90
 
        char *operator[](int ind) { return words[ind]; }
91
84
        void Clear();
92
85
        void Set(const char *s);
93
 
        char *Allocate(int size);
94
 
        void SetFromAllocated();
95
86
        bool InList(const char *s);
96
87
        bool InListAbbreviated(const char *s, const char marker);
97
 
        const char *GetNearestWord(const char *wordStart, int searchLen,
98
 
                bool ignoreCase = false, SString wordCharacters="", int wordIndex = -1);
99
 
        char *GetNearestWords(const char *wordStart, int searchLen,
100
 
                bool ignoreCase=false, char otherSeparator='\0', bool exactLen=false);
101
88
};
102
89
 
103
90
inline bool IsAlphabetic(unsigned int ch) {
104
91
        return ((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z'));
105
92
}
106
93
 
 
94
#ifdef SCI_NAMESPACE
 
95
}
 
96
#endif
107
97
 
108
98
#ifdef _MSC_VER
109
 
// Visual C++ doesn't like the private copy idiom for disabling
110
 
// the default copy constructor and operator=, but it's fine.
 
99
/* Visual C++ doesn't like the private copy idiom for disabling
 
100
 * the default copy constructor and operator=, but it's fine. */
111
101
#pragma warning(disable: 4511 4512)
112
102
#endif
113
103