|
/* This file is a part of SmartLexicon, a multi-lingual dictionary engine.
Copyright (C) 2005, Kostas Giannakakis
SmartLexicon is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
SmartLexicon is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SmartLexicon; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#pragma once
#include "..\LexIndexFileBase.h"
#include "LexSourceFileBab.h"
#include "libbab.h"
#include <vector>
using std::vector;
using std::list;
class CLexIndexFileBab : public CLexIndexFileBase
{
public:
/// Constructor
CLexIndexFileBab();
/// Destructor
~CLexIndexFileBab(void);
static CLexIndexFileBase* CreateNew() {return (new CLexIndexFileBab);};
virtual int LoadNew(CLexSourceFileBase *aSourceFile);
virtual int Load(CLexSourceFileBase *aSourceFile, CString aName);
virtual int GetProgress();
virtual void GetProgressMessage(CString &str);
virtual void StopLoading();
virtual BOOL IsLoadingOver(BOOL& result);
virtual int FindWords(const CString& wordStart,
vector<int> *wordAppearancesVector,
BOOL completeWord = FALSE,
BOOL exactMatch = FALSE);
protected:
BOOL IsValidEntry(CString &entry);
private:
void CString2string(const CString& cstr, string& str)
{
str = "";
for(int i = 0; i < cstr.GetLength(); i++)
{
char c = (char) cstr.GetAt(i);
str += c;
}
};
void string2CString(const string& str, CString& cstr)
{
cstr = "";
for(int i = 0; i < (int) str.size(); i++)
{
unsigned char c = str.at(i);
TCHAR tc = (TCHAR) c;
cstr += tc;
}
};
babylon *bab;
CString dictionary;
CLexSourceFileBab *sourceFile;
};
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.