diff options
author | Roberto C. Sanchez <roberto@connexer.com> | 2014-03-29 10:53:49 -0400 |
---|---|---|
committer | Roberto C. Sanchez <roberto@connexer.com> | 2014-03-29 10:53:49 -0400 |
commit | 8c8aa6b07e595cfac56838b5964ab3e96051f1b2 (patch) | |
tree | da38e2c1979148dbd3b0c7b87f930746f5ba7f44 /bindings/corba/orbitcpp/testclient.cpp | |
parent | 8d3fc864d094eeadc721f8e93436b37a5fab173e (diff) |
Imported Upstream version 1.5.7
Diffstat (limited to 'bindings/corba/orbitcpp/testclient.cpp')
-rw-r--r-- | bindings/corba/orbitcpp/testclient.cpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/bindings/corba/orbitcpp/testclient.cpp b/bindings/corba/orbitcpp/testclient.cpp new file mode 100644 index 0000000..2bbb60c --- /dev/null +++ b/bindings/corba/orbitcpp/testclient.cpp @@ -0,0 +1,61 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: f; c-basic-offset: 4 -*- */ + +#include "swordorb-cpp-stubs.h" +#include "swordorb-cpp-common.h" +#include <iostream> + +int main (int argc, char *argv[]) +{ + if (argc != 2) + { + std::cerr << "Usage:" << std::endl + << " " << argv[0] << " IOR" << std::endl + << std::endl; + return -1; + } + + try + { + // Initialize ORBit + CORBA::ORB_ptr orb = CORBA::ORB_init(argc, argv, "orbit-local-orb"); + + // Get a reference to the server from the IOR passed on the + // command line + CORBA::Object_var obj = orb->string_to_object(argv[1]); + swordorb::SWMgr_var mgr = swordorb::SWMgr::_narrow(obj); + + swordorb::SWModule_ptr module; + swordorb::ModInfoList *modInfoList; + + std::cout << "Connected: " << mgr->testConnection() << "\n"; + std::cout << "PrefixPath: " << mgr->getPrefixPath() << "\n"; + 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("NASB"); + module->setKeyText("jn3:1"); + std::cout << module->getRenderText(); + /* + swordorb::SearchHitList *searchResults; + searchResults = module->search("God love world", swordorb::MULTIWORD, 0, ""); + for (int i = 0; i < searchResults->length(); i++) { + std::cout << (*searchResults)[i].key << "\n"; + } + */; + + + + } catch(const CORBA::Exception& ex) { + std::cout << "Exception caught. Maybe the server is not running, or the IOR is wrong." << std::endl; + } + + return 0; +} |