[sword-cvs] sword/bindings/corba/orbitcpp Makefile,1.4,1.5 swordorb-impl.cpp,1.8,1.9 swordorb-impl.hpp,1.7,1.8 testclient.cpp,1.7,1.8
sword@www.crosswire.org
sword@www.crosswire.org
Sat, 30 Aug 2003 18:58:16 -0700
Update of /usr/local/cvsroot/sword/bindings/corba/orbitcpp
In directory www:/tmp/cvs-serv24365/bindings/corba/orbitcpp
Modified Files:
Makefile swordorb-impl.cpp swordorb-impl.hpp testclient.cpp
Log Message:
Index: Makefile
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/corba/orbitcpp/Makefile,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- Makefile 6 May 2003 03:27:56 -0000 1.4
+++ Makefile 31 Aug 2003 01:58:13 -0000 1.5
@@ -1,7 +1,16 @@
all: server testclient
+#comment these out if you didn't compile sword with lucene support
+luceneflags=-DUSELUCENE
+lucenelibs=-lclucene
+#----------------------------------
+
+LIBS += ${lucenelibs}
+CFLAGS += ${luceneflags}
+CXXFLAGS += ${luceneflags}
+
server: swordorb-common.o server.cpp swordorb-impl.o swordorb-cpp.o swordorb-cpp-common.o swordorb-stubs.o swordorb-cpp-stubs.o swordorb-cpp-skels.o swordorb-skels.o swordorb-cpp.o
- g++ -g -I. -I../../../include -I/usr/include/orbitcpp-2.0/ `orbit2-config --cflags` -o server server.cpp swordorb-impl.o swordorb-common.o swordorb-cpp-common.o swordorb-stubs.o swordorb-cpp-stubs.o swordorb-cpp-skels.o swordorb-skels.o `orbit2-config --libs` -lORBit-2-cpp -lsword -lz
+ g++ -g -I. -I../../../include -I/usr/include/orbitcpp-2.0/ `orbit2-config --cflags` -o server server.cpp swordorb-impl.o swordorb-common.o swordorb-cpp-common.o swordorb-stubs.o swordorb-cpp-stubs.o swordorb-cpp-skels.o swordorb-skels.o `orbit2-config --libs` -lORBit-2-cpp -lsword -lz ${LIBS}
testclient: testclient.cpp swordorb-impl.cpp swordorb-common.o swordorb-cpp-common.o swordorb-stubs.o swordorb-cpp-stubs.o swordorb-skels.o swordorb-cpp-skels.o
g++ -I. -I../../../include -I/usr/include/orbitcpp-2.0/ `orbit2-config --cflags` -o testclient testclient.cpp swordorb-common.o swordorb-cpp-common.o swordorb-stubs.o swordorb-cpp-stubs.o swordorb-skels.o swordorb-cpp-skels.o `orbit2-config --libs` -lORBit-2-cpp
Index: swordorb-impl.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/corba/orbitcpp/swordorb-impl.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- swordorb-impl.cpp 22 Aug 2003 15:14:02 -0000 1.8
+++ swordorb-impl.cpp 31 Aug 2003 01:58:13 -0000 1.9
@@ -92,7 +92,7 @@
}
-StringList *SWModule_impl::search(const char *istr, SearchType searchType, CORBA::Long flags, const char *scope) throw(CORBA::SystemException) {
+SearchHitList *SWModule_impl::search(const char *istr, SearchType searchType, CORBA::Long flags, const char *scope) throw(CORBA::SystemException) {
int stype = 2;
sword::ListKey lscope;
sword::VerseKey parser;
@@ -107,13 +107,16 @@
}
else result = delegate->Search(istr, stype, flags);
- StringList *retVal = new StringList;
+ SearchHitList *retVal = new SearchHitList;
int count = 0;
for (result = sword::TOP; !result.Error(); result++) count++;
retVal->length(count);
int i = 0;
- for (result = sword::TOP; !result.Error(); result++)
- (*retVal)[i++] = CORBA::string_dup((const char *)result);
+ for (result = sword::TOP; !result.Error(); result++) {
+ (*retVal)[i].modName = CORBA::string_dup(delegate->Name());
+ (*retVal)[i].key = CORBA::string_dup((const char *)result);
+ (*retVal)[i++].score = (long)result.getElement()->userData;
+ }
return retVal;
}
Index: swordorb-impl.hpp
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/corba/orbitcpp/swordorb-impl.hpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- swordorb-impl.hpp 22 Aug 2003 15:14:03 -0000 1.7
+++ swordorb-impl.hpp 31 Aug 2003 01:58:13 -0000 1.8
@@ -19,7 +19,7 @@
public:
SWModule_impl(sword::SWModule *delegate) { this->delegate = delegate; }
- StringList *search(const char *istr, SearchType searchType, CORBA::Long flags, const char *scope) throw(CORBA::SystemException);
+ SearchHitList *search(const char *istr, SearchType searchType, CORBA::Long flags, const char *scope) throw(CORBA::SystemException);
void terminateSearch() throw(CORBA::SystemException) { delegate->terminateSearch = true; }
char error() throw(CORBA::SystemException) { return delegate->Error(); }
CORBA::Long getEntrySize() throw(CORBA::SystemException) { return delegate->getEntrySize(); }
Index: testclient.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/bindings/corba/orbitcpp/testclient.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- testclient.cpp 22 Aug 2003 15:14:03 -0000 1.7
+++ testclient.cpp 31 Aug 2003 01:58:13 -0000 1.8
@@ -32,17 +32,19 @@
std::cout << "ConfigPath: " << mgr->getConfigPath() << "\n";
modInfoList = mgr->getModInfoList();
std::cout << "sequence length: " << modInfoList->length() << "\n";
+/*
for (int i = 0; i < modInfoList->length(); i++) {
std::cout << (*modInfoList)[i].name << ": " << (*modInfoList)[i].category << ": " << (*modInfoList)[i].language << "\n";
module = mgr->getModuleByName((*modInfoList)[i].name);
module->setKeyText("jas1:19");
std::cout << module->getRenderText() << "\n";
}
- module = mgr->getModuleByName((*modInfoList)[0].name);
- swordorb::StringList *searchResults;
- searchResults = module->search("God love world", swordorb::MULTIWORD, 0, "act-Rev");
+*/
+ module = mgr->getModuleByName("KJV");
+ swordorb::SearchHitList *searchResults;
+ searchResults = module->search("God love world", swordorb::MULTIWORD, 0, "");
for (int i = 0; i < searchResults->length(); i++) {
- std::cout << (*searchResults)[i] << "\n";
+ std::cout << (*searchResults)[i].key << "\n";
}