| 1 |
/* |
| 2 |
* AikSaurus - An open source thesaurus library |
| 3 |
* Copyright (C) 2001 by Jared Davis |
| 4 |
* |
| 5 |
* This program is free software; you can redistribute it and/or |
| 6 |
* modify it under the terms of the GNU General Public License |
| 7 |
* as published by the Free Software Foundation; either version 2 |
| 8 |
* of the License, or (at your option) any later version. |
| 9 |
* |
| 10 |
* This program is distributed in the hope that it will be useful, |
| 11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
* GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this program; if not, write to the Free Software |
| 17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA |
| 18 |
* 02111-1307, USA. |
| 19 |
* |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef INCLUDED_WORDSFILE_H |
| 23 |
#define INCLUDED_WORDSFILE_H |
| 24 |
|
| 25 |
class FileArray; |
| 26 |
|
| 27 |
class WordsFile |
| 28 |
{ |
| 29 |
private: |
| 30 |
|
| 31 |
// No copying or assignment allowed. |
| 32 |
WordsFile(const WordsFile& rhs); |
| 33 |
WordsFile& operator=(const WordsFile& rhs); |
| 34 |
|
| 35 |
// Information about maximum word size, link size. |
| 36 |
static const int s_maxword; |
| 37 |
static const int s_maxlinks; |
| 38 |
|
| 39 |
// Pointer to a file array, accesses the data. |
| 40 |
FileArray* d_data_ptr; |
| 41 |
|
| 42 |
// Any error is a problem with the file. |
| 43 |
bool d_error; |
| 44 |
|
| 45 |
|
| 46 |
public: |
| 47 |
|
| 48 |
// Creation and Destruction |
| 49 |
WordsFile(const char* fname); |
| 50 |
~WordsFile(); |
| 51 |
|
| 52 |
// Word Lookup |
| 53 |
int findWord(const char* str); |
| 54 |
|
| 55 |
// Word/Links Retrieval |
| 56 |
void loadWord(int id); |
| 57 |
const char* getWord() const; |
| 58 |
const int* getLinks() const; |
| 59 |
|
| 60 |
// Error Checking |
| 61 |
bool error() const; |
| 62 |
}; |
| 63 |
|
| 64 |
#endif // INCLUDED_WORDSFILE_H |
| 65 |
|