summaryrefslogtreecommitdiff
path: root/examples/cmdline/lookup.cpp
diff options
context:
space:
mode:
authorRoberto C. Sanchez <roberto@connexer.com>2014-03-29 10:53:49 -0400
committerRoberto C. Sanchez <roberto@connexer.com>2014-03-29 10:53:49 -0400
commit8c8aa6b07e595cfac56838b5964ab3e96051f1b2 (patch)
treeda38e2c1979148dbd3b0c7b87f930746f5ba7f44 /examples/cmdline/lookup.cpp
parent8d3fc864d094eeadc721f8e93436b37a5fab173e (diff)
Imported Upstream version 1.5.7
Diffstat (limited to 'examples/cmdline/lookup.cpp')
-rw-r--r--examples/cmdline/lookup.cpp33
1 files changed, 22 insertions, 11 deletions
diff --git a/examples/cmdline/lookup.cpp b/examples/cmdline/lookup.cpp
index a244fb3..502ca52 100644
--- a/examples/cmdline/lookup.cpp
+++ b/examples/cmdline/lookup.cpp
@@ -1,8 +1,18 @@
#include <stdio.h>
-#include <iostream.h>
+#include <iostream>
#include <stdlib.h>
#include <swmgr.h>
+#ifndef NO_SWORD_NAMESPACE
+using sword::SWMgr;
+using sword::SWModule;
+using sword::ModMap;
+using sword::SWKey;
+using sword::AttributeTypeList;
+using sword::AttributeValue;
+using sword::AttributeList;
+#endif
+
int main(int argc, char **argv)
{
SWMgr manager;
@@ -25,27 +35,28 @@ int main(int argc, char **argv)
target = (*it).second;
- target->SetKey(argv[2]);
+ target->setKey(argv[2]);
(const char *)*target; // force an entry lookup to resolve key so we
// get the idxbuf entry for the key
- cout << (const char *)(SWKey &)*target << ":\n";
- cout << target->StripText();
- cout << "\n";
- cout << "==========================\n";
- cout << "Entry Attributes:\n\n";
+ std::cout << (const char *)(SWKey &)*target << ":\n";
+// std::cout << target->StripText();
+ std::cout << target->getRawEntry();
+ std::cout << "\n";
+ std::cout << "==========================\n";
+ std::cout << "Entry Attributes:\n\n";
AttributeTypeList::iterator i1;
AttributeList::iterator i2;
AttributeValue::iterator i3;
for (i1 = target->getEntryAttributes().begin(); i1 != target->getEntryAttributes().end(); i1++) {
- cout << "[ " << i1->first << " ]\n";
+ std::cout << "[ " << i1->first << " ]\n";
for (i2 = i1->second.begin(); i2 != i1->second.end(); i2++) {
- cout << "\t[ " << i2->first << " ]\n";
+ std::cout << "\t[ " << i2->first << " ]\n";
for (i3 = i2->second.begin(); i3 != i2->second.end(); i3++) {
- cout << "\t\t" << i3->first << " = " << i3->second << "\n";
+ std::cout << "\t\t" << i3->first << " = " << i3->second << "\n";
}
}
}
- cout << endl;
+ std::cout << std::endl;
return 0;
}