From c249f2401aec8638a0ae1487cc1e91ea196c63d0 Mon Sep 17 00:00:00 2001 From: "Troy A. Griffitts" Date: Tue, 4 Sep 2007 00:48:05 +0000 Subject: Applied patch from Lyndon Drake fixing strongs def card and verifying KJV module is installed with user feedback if not Added standard crosswire header git-svn-id: https://www.crosswire.org/svn/sword-tools/trunk@97 07627401-56e2-0310-80f4-f8cd0041bdcd --- flashtools/Makefile | 2 +- flashtools/flash.cpp | 32 ++++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 3 deletions(-) (limited to 'flashtools') diff --git a/flashtools/Makefile b/flashtools/Makefile index dc41e0a..47852f0 100644 --- a/flashtools/Makefile +++ b/flashtools/Makefile @@ -7,6 +7,6 @@ clean: rm $(TARGETS) .cpp: - g++ -g `pkg-config --cflags sword` $< -o $@ `pkg-config --libs sword` + g++ -g `pkg-config --static --cflags sword` $< -o $@ `pkg-config --static --libs sword` diff --git a/flashtools/flash.cpp b/flashtools/flash.cpp index 71d4e42..012496d 100644 --- a/flashtools/flash.cpp +++ b/flashtools/flash.cpp @@ -1,3 +1,25 @@ +/****************************************************************************** + * flash.cpp - Automation of flashcards generation + * + * Copyright 2007 CrossWire Bible Society (http://www.crosswire.org) + * CrossWire Bible Society + * P. O. Box 2528 + * Tempe, AZ 85280-2528 + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation version 2. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * Contributors: + * Lyndon Drake + * Troy A. Griffitts + */ + #include #include #include @@ -201,7 +223,7 @@ void outputFlash(const vector &wordList, const char *outputDir = ".", bool } // if we would rather have short strongs else { - SWBuf answers = w.def; + answers = w.def; strip.processText(answers); // remove html tags answers.replaceBytes("\n\r", ' '); // remove newlines } @@ -241,13 +263,19 @@ void outputFlash(const vector &wordList, const char *outputDir = ".", bool */ vector processWords(const char *range, bool addAll = true) { SWMgr manager; - SWModule &bible = *manager.getModule("KJV"); map wordList; SWConfig hutf8("hwords.conf"); SWConfig hdefs("hdefs.conf"); SWConfig gutf8("gwords.conf"); SWConfig gdefs("gdefs.conf"); + + SWModule *tmpBible = manager.getModule("KJV"); + if (!tmpBible) { + cerr << "Unable to locate KJV module" << endl; + exit(1); + } + SWModule &bible = *tmpBible; VerseKey parser; ListKey r = parser.ParseVerseList(range, 0, true); -- cgit