#include "nsLuceneField.h" #include "nsLuceneStringConverter.h" #include "CLucene/CLConfig.h" #include "CLucene.h" NS_IMPL_ISUPPORTS1(nsLuceneField, nsILuceneField) nsLuceneField::nsLuceneField(lucene::document::Field* pField) { mField = pField; } lucene::document::Field* nsLuceneField::getField() { return mField; } nsLuceneField::~nsLuceneField() { /* * The Document takes responsibility for the field when it is added, so we * don't delete it here. Note that if a field is created but not added to * a document, it will leak. Should we track if it was added? */ } NS_IMETHODIMP nsLuceneField::GetName(nsAString& aName) { nsLuceneStringConverter::makeNsString((utf32_t*) mField->name(), aName); return NS_OK; } NS_IMETHODIMP nsLuceneField::SetName(const nsAString& aName) { return NS_ERROR_NOT_IMPLEMENTED; } NS_IMETHODIMP nsLuceneField::GetStringValue(nsAString& aStringValue) { nsLuceneStringConverter::makeNsString((utf32_t*) mField->stringValue(), aStringValue); return NS_OK; } NS_IMETHODIMP nsLuceneField::SetStringValue(const nsAString& aStringValue) { return NS_ERROR_NOT_IMPLEMENTED; }