[sword-svn] r2030 - trunk/examples/classes
scribe at www.crosswire.org
scribe at www.crosswire.org
Sat Feb 10 14:16:51 MST 2007
Author: scribe
Date: 2007-02-10 14:16:50 -0700 (Sat, 10 Feb 2007)
New Revision: 2030
Modified:
trunk/examples/classes/Makefile
trunk/examples/classes/ciphercng.cpp
trunk/examples/classes/swmgrex.cpp
Log:
Updated to work with latest sword libs and compile outside sword
make system
Modified: trunk/examples/classes/Makefile
===================================================================
--- trunk/examples/classes/Makefile 2007-02-07 20:22:58 UTC (rev 2029)
+++ trunk/examples/classes/Makefile 2007-02-10 21:16:50 UTC (rev 2030)
@@ -1,7 +1,10 @@
-root := ../..
-subdirs :=
-pre-targets :=
-bin := yes
-targets := swmgrex ciphercng
-include ${root}/Makefile.cfg
+TARGETS= ciphercng swmgrex
+all: $(TARGETS)
+clean:
+ rm $(TARGETS)
+
+.cpp:
+ g++ `pkg-config --cflags sword` $< -o $@ `pkg-config --libs sword`
+
+
Modified: trunk/examples/classes/ciphercng.cpp
===================================================================
--- trunk/examples/classes/ciphercng.cpp 2007-02-07 20:22:58 UTC (rev 2029)
+++ trunk/examples/classes/ciphercng.cpp 2007-02-10 21:16:50 UTC (rev 2030)
@@ -6,8 +6,15 @@
*
*/
+#include <iostream>
+
#include <swmgr.h>
+#include <swmodule.h>
+
+using namespace sword;
+using namespace std;
+
int main(int argc, char **argv) {
if (argc != 2) {
@@ -36,7 +43,7 @@
cout << "\n\nEnter new cipher key: ";
cin >> key;
cout << "\nSetting key to: " << key;
- manager.setCipherKey(argv[1], (unsigned char *)key.c_str());
+ manager.setCipherKey(argv[1], key.c_str());
}
Modified: trunk/examples/classes/swmgrex.cpp
===================================================================
--- trunk/examples/classes/swmgrex.cpp 2007-02-07 20:22:58 UTC (rev 2029)
+++ trunk/examples/classes/swmgrex.cpp 2007-02-10 21:16:50 UTC (rev 2030)
@@ -8,13 +8,19 @@
*
* SWMgr makes its modules available as an STL Map.
* The Map definition is typedef'ed as ModMap
- * ModMap consists of: FIRST : string moduleName
+ * ModMap consists of: FIRST : SWBuf moduleName
* SECOND: SWModule *module
*
*/
+#include <iostream>
+
#include <swmgr.h>
+#include <swmodule.h>
+using namespace sword;
+using namespace std;
+
main() {
SWMgr manager; // create a default manager that looks in the current directory for mods.conf
@@ -25,7 +31,7 @@
// Loop thru all installed modules and print out information
for (modIterator = manager.Modules.begin(); modIterator != manager.Modules.end(); modIterator++) {
- string modName = (*modIterator).first; // mod.conf section name (stored in module->Name())
+ SWBuf modName = (*modIterator).first; // mod.conf section name (stored in module->Name())
SWModule *module = (*modIterator).second;
cout << modName << "(" << module->Name() << ") | " << module->Type() << "\n";
More information about the sword-cvs
mailing list