CLucene - a full-featured, c++ search engine
API Documentation
00001 /*------------------------------------------------------------------------------ 00002 * Copyright (C) 2003-2006 Ben van Klinken and the CLucene Team 00003 * 00004 * Distributable under the terms of either the Apache License (Version 2.0) or 00005 * the GNU Lesser General Public License, as specified in the COPYING file. 00006 ------------------------------------------------------------------------------*/ 00007 #ifndef _lucene_document_Document_ 00008 #define _lucene_document_Document_ 00009 00010 CL_CLASS_DEF(document,Field) 00011 00012 00013 00014 CL_NS_DEF(document) 00015 00016 class Document; //predefine 00017 class DocumentFieldEnumeration :LUCENE_BASE{ 00018 class DocumentFieldList :LUCENE_BASE{ 00019 public: 00020 DocumentFieldList(Field* f, DocumentFieldList* n); 00021 ~DocumentFieldList(); 00022 Field* field; 00023 DocumentFieldList* next; 00024 }; 00025 friend class Document; 00026 private: 00027 const DocumentFieldList* fields; 00028 public: 00029 DocumentFieldEnumeration(const DocumentFieldList* fl); 00030 ~DocumentFieldEnumeration(); 00031 bool hasMoreElements() const; 00032 Field* nextElement(); 00033 }; 00034 00048 class CLUCENE_EXPORT Document:LUCENE_BASE { 00049 private: 00050 DocumentFieldEnumeration::DocumentFieldList* fieldList; 00051 float_t boost; 00052 public: 00054 Document(); 00055 00056 ~Document(); 00057 00069 void setBoost(const float_t boost); 00070 00083 float_t getBoost() const; 00084 00096 void add(Field& field); 00097 00109 void removeField(const TCHAR* name); 00110 00121 void removeFields(const TCHAR* name); 00122 00129 Field* getField(const TCHAR* name) const; 00130 00137 const TCHAR* get(const TCHAR* field) const; 00138 00142 _CL_DEPRECATED( getFields() ) DocumentFieldEnumeration* fields() const; 00143 00149 DocumentFieldEnumeration* getFields() const; 00150 00152 TCHAR* toString() const; 00153 00154 00163 TCHAR** getValues(const TCHAR* name); 00164 00168 void clear(); 00169 }; 00170 CL_NS_END 00171 #endif