~ubuntu-branches/ubuntu/trusty/codeblocks/trusty-proposed

« back to all changes in this revision

Viewing changes to src/sdk/wxscintilla/src/scintilla/src/CharClassify.h

  • Committer: Bazaar Package Importer
  • Author(s): David Paleino
  • Date: 2011-01-22 20:58:57 UTC
  • mfrom: (3.1.3 maverick)
  • Revision ID: james.westby@ubuntu.com-20110122205857-mlwokxogiic0dnu7
Tags: 10.05-1
* Initial Debian release (Closes: #304570)
* Setting myself as Maintainer, original Ubuntu maintainer set as
  Uploader
* Use debian/watch to get the original tarball, instead of an ad-hoc
  script
* Wrap multivalue fields in debian/control
* Update debian/copyright with lots of missing info, and use DEP-5
* Add missing linkage to libX11 (03-fix_libX11_linkage.patch)
* Use dh7 for debian/rules
* Build-Depend on dh-autoreconf, since we need to re-generate autotools
  machinery (libtool version mismatch)
* Migrate from libwxsmithlib0-dev to libwxsmithlib-dev, to ease
  future SONAME bumps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Scintilla source code edit control
 
2
/** @file CharClassify.h
 
3
 ** Character classifications used by Document and RESearch.
 
4
 **/
 
5
// Copyright 2006-2009 by Neil Hodgson <neilh@scintilla.org>
 
6
// The License.txt file describes the conditions under which this software may be distributed.
 
7
 
 
8
#ifndef CHARCLASSIFY_H
 
9
#define CHARCLASSIFY_H
 
10
 
 
11
class CharClassify {
 
12
public:
 
13
        CharClassify();
 
14
 
 
15
        enum cc { ccSpace, ccNewLine, ccWord, ccPunctuation };
 
16
        void SetDefaultCharClasses(bool includeWordClass);
 
17
        void SetCharClasses(const unsigned char *chars, cc newCharClass);
 
18
        cc GetClass(unsigned char ch) const { return static_cast<cc>(charClass[ch]);}
 
19
        bool IsWord(unsigned char ch) const { return static_cast<cc>(charClass[ch]) == ccWord;}
 
20
 
 
21
private:
 
22
        enum { maxChar=256 };
 
23
        unsigned char charClass[maxChar];    // not type cc to save space
 
24
};
 
25
 
 
26
// These functions are implemented because each platform calls them something different.
 
27
int CompareCaseInsensitive(const char *a, const char *b);
 
28
int CompareNCaseInsensitive(const char *a, const char *b, size_t len);
 
29
 
 
30
inline char MakeUpperCase(char ch) {
 
31
        if (ch < 'a' || ch > 'z')
 
32
                return ch;
 
33
        else
 
34
                return static_cast<char>(ch - 'a' + 'A');
 
35
}
 
36
 
 
37
#endif