~ubuntu-branches/ubuntu/natty/geany/natty

« back to all changes in this revision

Viewing changes to scintilla/ExternalLexer.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Chow Loong Jin
  • Date: 2010-08-07 03:23:12 UTC
  • mfrom: (1.4.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 22.
  • Revision ID: james.westby@ubuntu.com-20100807032312-ot70ac9d50cn79we
Tags: upstream-0.19
ImportĀ upstreamĀ versionĀ 0.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
#include <string.h>
11
11
#include <ctype.h>
12
12
 
 
13
#include <string>
 
14
 
13
15
#include "Platform.h"
14
16
 
15
17
#include "Scintilla.h"
38
40
        while (val[dim])
39
41
                dim++;
40
42
        char **wls = new char * [dim + 1];
41
 
        for (int i = 0;i < dim;i++) {
42
 
                SString words;
 
43
        for (int i = 0; i < dim; i++) {
 
44
                std::string words;
43
45
                words = "";
44
46
                for (int n = 0; n < val[i]->len; n++) {
45
47
                        words += val[i]->words[n];
112
114
//
113
115
//------------------------------------------
114
116
 
115
 
LexerLibrary::LexerLibrary(const char* ModuleName) {
 
117
LexerLibrary::LexerLibrary(const char *ModuleName) {
116
118
        // Initialise some members...
117
119
        first = NULL;
118
120
        last = NULL;
193
195
 
194
196
/// Return the single LexerManager instance...
195
197
LexerManager *LexerManager::GetInstance() {
196
 
        if(!theInstance)
 
198
        if (!theInstance)
197
199
                theInstance = new LexerManager;
198
200
        return theInstance;
199
201
}
200
202
 
201
203
/// Delete any LexerManager instance...
202
 
void LexerManager::DeleteInstance()
203
 
{
204
 
        if(theInstance) {
205
 
                delete theInstance;
206
 
                theInstance = NULL;
207
 
        }
 
204
void LexerManager::DeleteInstance() {
 
205
        delete theInstance;
 
206
        theInstance = NULL;
208
207
}
209
208
 
210
209
/// protected constructor - this is a singleton...
217
216
        Clear();
218
217
}
219
218
 
220
 
void LexerManager::Load(const char* path)
221
 
{
 
219
void LexerManager::Load(const char *path) {
222
220
        LoadLexerLibrary(path);
223
221
}
224
222
 
225
 
void LexerManager::LoadLexerLibrary(const char* module)
226
 
{
 
223
void LexerManager::LoadLexerLibrary(const char *module) {
 
224
        for (LexerLibrary *ll = first; ll; ll= ll->next) {
 
225
                if (strcmp(ll->m_sModuleName.c_str(), module) == 0)
 
226
                        return;
 
227
        }
227
228
        LexerLibrary *lib = new LexerLibrary(module);
228
229
        if (NULL != first) {
229
230
                last->next = lib;
234
235
        }
235
236
}
236
237
 
237
 
void LexerManager::Clear()
238
 
{
 
238
void LexerManager::Clear() {
239
239
        if (NULL != first) {
240
240
                LexerLibrary *cur = first;
241
241
                LexerLibrary *next;
255
255
//
256
256
//------------------------------------------
257
257
 
258
 
LMMinder::~LMMinder()
259
 
{
 
258
LMMinder::~LMMinder() {
260
259
        LexerManager::DeleteInstance();
261
260
}
262
261