~ubuntu-branches/ubuntu/raring/codeblocks/raring-proposed

« back to all changes in this revision

Viewing changes to src/sdk/wxscintilla/src/scintilla/include/PropSet.h

  • Committer: Bazaar Package Importer
  • Author(s): Cosme Domínguez Díaz
  • Date: 2010-08-09 04:38:38 UTC
  • mfrom: (1.1.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 4.
  • Revision ID: james.westby@ubuntu.com-20100809043838-a59ygguym4eg0jgw
Tags: 10.05-0ubuntu1
* New upstream release. Closes (LP: #322350)
 - Switch to dpkg-source 3.0 (quilt) format
 - Remove unneeded README.source
 - Add debian/get-source-orig script that removes all
   Windows prebuilt binaries
* Bump Standards-Version to 3.9.1
 - Stop shipping *.la files
* debian/control
 - Add cdbs package as Build-Depend
 - Add libbz2-dev and zlib1g-dev packages as
   Build-Depends (needed by libhelp_plugin.so)
 - Remove dpatch package of Build-Depends
 - Add codeblocks-contrib-debug package
 - Split architecture-independent files of codeblocks
   package in codeblocks-common package
* debian/rules
 - Switch to CDBS rules system
 - Add parallel build support
 - Add a call to debian/get-source-orig script
 - Use lzma compression (saves 23,5 MB of free space)
* debian/patches
 - Refresh 01_codeblocks_plugin_path
 - Add 02_no_Makefiles_in_debian_dir to remove any link
   in codeblocks build system to deleted Makefiles of debian directory
 - Drop 02_ftbfs_gcc44 and 03_ftbfs_glib221 (merged in upstream)
* debian/watch
 - Update to use the new host (berlios.de)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// Scintilla source code edit control
2
2
/** @file PropSet.h
3
 
 ** A Java style properties file module.
 
3
 ** An interface to the methods needed for access to property sets inside lexers.
4
4
 **/
5
 
// Copyright 1998-2002 by Neil Hodgson <neilh@scintilla.org>
 
5
// Copyright 1998-2009 by Neil Hodgson <neilh@scintilla.org>
6
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
10
 
#include "SString.h"
11
 
 
12
 
bool EqualCaseInsensitive(const char *a, const char *b);
13
 
 
14
 
bool isprefix(const char *target, const char *prefix);
15
 
 
16
 
struct Property {
17
 
        unsigned int hash;
18
 
        char *key;
19
 
        char *val;
20
 
        Property *next;
21
 
        Property() : hash(0), key(0), val(0), next(0) {}
22
 
};
23
 
 
24
 
/**
25
 
 */
26
 
class PropSet {
27
 
protected:
28
 
        enum { hashRoots=31 };
29
 
        Property *props[hashRoots];
30
 
        Property *enumnext;
31
 
        int enumhash;
32
 
        static bool caseSensitiveFilenames;
33
 
        static unsigned int HashString(const char *s, size_t len) {
34
 
                unsigned int ret = 0;
35
 
                while (len--) {
36
 
                        ret <<= 4;
37
 
                        ret ^= *s;
38
 
                        s++;
39
 
                }
40
 
                return ret;
41
 
        }
42
 
        static bool IncludesVar(const char *value, const char *key);
43
 
 
44
 
public:
45
 
        PropSet *superPS;
46
 
        PropSet();
47
 
        ~PropSet();
48
 
        void Set(const char *key, const char *val, int lenKey=-1, int lenVal=-1);
49
 
        void Set(const char *keyVal);
50
 
        void Unset(const char *key, int lenKey=-1);
51
 
        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="");
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
 
        }
65
 
 
66
 
private:
67
 
        // copy-value semantics not implemented
68
 
        PropSet(const PropSet &copy);
69
 
        void operator=(const PropSet &assign);
70
 
};
71
 
 
72
 
/**
73
 
 */
74
 
class WordList {
75
 
public:
76
 
        // Each word contains at least one character - a empty word acts as sentinel at the end.
77
 
        char **words;
78
 
        char **wordsNoCase;
79
 
        char *list;
80
 
        int len;
81
 
        bool onlyLineEnds;      ///< Delimited by any white space or only line ends
82
 
        bool sorted;
83
 
        bool sortedNoCase;
84
 
        int starts[256];
85
 
        WordList(bool onlyLineEnds_ = false) :
86
 
                words(0), wordsNoCase(0), list(0), len(0), onlyLineEnds(onlyLineEnds_),
87
 
                sorted(false), sortedNoCase(false) {}
88
 
        ~WordList() { Clear(); }
89
 
        operator bool() { return len ? true : false; }
90
 
        char *operator[](int ind) { return words[ind]; }
91
 
        void Clear();
92
 
        void Set(const char *s);
93
 
        char *Allocate(int size);
94
 
        void SetFromAllocated();
95
 
        bool InList(const char *s);
96
 
        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
 
};
102
 
 
103
 
inline bool IsAlphabetic(unsigned int ch) {
104
 
        return ((ch >= 'A') && (ch <= 'Z')) || ((ch >= 'a') && (ch <= 'z'));
 
10
 
 
11
#ifdef SCI_NAMESPACE
 
12
namespace Scintilla {
 
13
#endif
 
14
 
 
15
class PropertyGet {
 
16
public:
 
17
        virtual char *ToString() const=0;       // Caller must delete[] the return value
 
18
        virtual int GetInt(const char *key, int defaultValue=0) const=0;
 
19
        virtual ~PropertyGet() {}
 
20
};
 
21
 
 
22
#ifdef SCI_NAMESPACE
105
23
}
106
 
 
107
 
 
108
 
#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.
111
 
#pragma warning(disable: 4511 4512)
112
24
#endif
113
25
 
114
26
#endif