[sword-svn] r3187 - in branches/sword-1-7-x: . examples/cmdline

greg.hellings at crosswire.org greg.hellings at crosswire.org
Wed Apr 16 21:34:04 MST 2014


Author: greg.hellings
Date: 2014-04-16 21:34:03 -0700 (Wed, 16 Apr 2014)
New Revision: 3187

Modified:
   branches/sword-1-7-x/
   branches/sword-1-7-x/examples/cmdline/lookup.cpp
Log:
Merging r3154 - improved lookup example



Property changes on: branches/sword-1-7-x
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:2989-2991,2997,3001-3004,3006,3010-3013,3015-3020,3026-3039,3045-3046,3048,3056,3058-3062,3067,3073,3077-3081,3085-3086,3091,3094,3097-3099,3102,3104,3106-3108,3110,3115,3118-3121,3126-3127,3131-3135,3140,3144,3151,3153
   + /trunk:2989-2991,2997,3001-3004,3006,3010-3013,3015-3020,3026-3039,3045-3046,3048,3056,3058-3062,3067,3073,3077-3081,3085-3086,3091,3094,3097-3099,3102,3104,3106-3108,3110,3115,3118-3121,3126-3127,3131-3135,3140,3144,3151,3153-3154

Modified: branches/sword-1-7-x/examples/cmdline/lookup.cpp
===================================================================
--- branches/sword-1-7-x/examples/cmdline/lookup.cpp	2014-04-17 04:33:19 UTC (rev 3186)
+++ branches/sword-1-7-x/examples/cmdline/lookup.cpp	2014-04-17 04:34:03 UTC (rev 3187)
@@ -102,12 +102,19 @@
 	AttributeTypeList::iterator i1;
 	AttributeList::iterator i2;
 	AttributeValue::iterator i3;
+	bool heading = false;
+	bool preverse = false;
 	for (i1 = target->getEntryAttributes().begin(); i1 != target->getEntryAttributes().end(); ++i1) {
 		std::cout << "[ " << i1->first << " ]\n";
+		heading = (i1->first == "Heading");
 		for (i2 = i1->second.begin(); i2 != i1->second.end(); ++i2) {
 			std::cout << "\t[ " << i2->first << " ]\n";
+			preverse = (heading && i2->first == "Preverse");
 			for (i3 = i2->second.begin(); i3 != i2->second.end(); ++i3) {
 				std::cout << "\t\t" << i3->first << " = " << i3->second << "\n";
+				if (preverse) {
+					std::cout << "\t\tmodule->renderText(heading[" << i3->first << "]) = " << target->renderText(i3->second) << "\n";
+				}
 			}
 		}
 	}




More information about the sword-cvs mailing list