From 7a00574163029c0c2b649878c95d5acbd083564a Mon Sep 17 00:00:00 2001 From: "Roberto C. Sanchez" Date: Mon, 12 May 2014 08:21:30 -0400 Subject: Imported Upstream version 1.7.2+dfsg --- examples/Makefile.in | 314 +++++++++++++++++++------------- examples/classes/Makefile | 4 +- examples/classes/README | 4 + examples/classes/ciphercng.cpp | 19 +- examples/classes/lastVerseInChapter.cpp | 56 ++++++ examples/classes/showchapter.cpp | 57 ++++++ examples/classes/swmgrex.cpp | 44 +++-- examples/classes/verseposition.cpp | 51 ++++++ examples/classes/verseranges.cpp | 127 +++++++++++++ examples/cmdline/CMakeLists.txt | 1 + examples/cmdline/Makefile.am | 4 +- examples/cmdline/Makefile.in | 295 +++++++++++++++++++++--------- examples/cmdline/listoptions.cpp | 22 ++- examples/cmdline/lookup.cpp | 32 ++-- examples/cmdline/outplain.cpp | 48 +++-- examples/cmdline/outrender.cpp | 42 +++-- examples/cmdline/search.cpp | 40 ++-- examples/cmdline/threaded_search.cpp | 22 ++- examples/cmdline/verserangeparse.cpp | 48 ++--- examples/simple.cpp | 11 +- 20 files changed, 868 insertions(+), 373 deletions(-) create mode 100644 examples/classes/README create mode 100644 examples/classes/lastVerseInChapter.cpp create mode 100644 examples/classes/showchapter.cpp create mode 100644 examples/classes/verseposition.cpp create mode 100644 examples/classes/verseranges.cpp (limited to 'examples') diff --git a/examples/Makefile.in b/examples/Makefile.in index 1c30393..31f1f33 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -15,6 +14,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -35,33 +79,71 @@ build_triplet = @build@ host_triplet = @host@ target_triplet = @target@ subdir = examples -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_clucene.m4 \ - $(top_srcdir)/m4/colored-echo.m4 $(top_srcdir)/m4/cppunit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/cppunit.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = SOURCES = DIST_SOURCES = -RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ - html-recursive info-recursive install-data-recursive \ - install-dvi-recursive install-exec-recursive \ - install-html-recursive install-info-recursive \ - install-pdf-recursive install-ps-recursive install-recursive \ - installcheck-recursive installdirs-recursive pdf-recursive \ - ps-recursive uninstall-recursive +RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ + ctags-recursive dvi-recursive html-recursive info-recursive \ + install-data-recursive install-dvi-recursive \ + install-exec-recursive install-html-recursive \ + install-info-recursive install-pdf-recursive \ + install-ps-recursive install-recursive installcheck-recursive \ + installdirs-recursive pdf-recursive ps-recursive \ + tags-recursive uninstall-recursive +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \ - $(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \ +am__recursive_targets = \ + $(RECURSIVE_TARGETS) \ + $(RECURSIVE_CLEAN_TARGETS) \ + $(am__extra_recursive_targets) +AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ distdir +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DIST_SUBDIRS = $(SUBDIRS) @@ -93,7 +175,9 @@ am__relativize = \ reldir="$$dir2" ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -103,6 +187,8 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CLUCENE2_CFLAGS = @CLUCENE2_CFLAGS@ +CLUCENE2_LIBS = @CLUCENE2_LIBS@ CLUCENE_CXXFLAGS = @CLUCENE_CXXFLAGS@ CLUCENE_LIBS = @CLUCENE_LIBS@ CPP = @CPP@ @@ -128,9 +214,6 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ -GENCCODE = @GENCCODE@ -GENCMN = @GENCMN@ -GENRB = @GENRB@ GREP = @GREP@ ICU_CONFIG = @ICU_CONFIG@ ICU_IOLIBS = @ICU_IOLIBS@ @@ -151,6 +234,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -163,20 +247,29 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PKGDATA = @PKGDATA@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +SWORD_VERSION_MAJOR = @SWORD_VERSION_MAJOR@ +SWORD_VERSION_MICRO = @SWORD_VERSION_MICRO@ +SWORD_VERSION_MINOR = @SWORD_VERSION_MINOR@ +SWORD_VERSION_NANO = @SWORD_VERSION_NANO@ +SWORD_VERSION_NUM = @SWORD_VERSION_NUM@ +SWORD_VERSION_STR = @SWORD_VERSION_STR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -213,7 +306,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -282,22 +374,25 @@ clean-libtool: -rm -rf .libs _libs # This directory's subdirectories are mostly independent; you can cd -# into them and run `make' without going through this Makefile. -# To change the values of `make' variables: instead of editing Makefiles, -# (1) if the variable is set in `config.status', edit `config.status' -# (which will cause the Makefiles to be regenerated when you run `make'); -# (2) otherwise, pass the desired values on the `make' command line. -$(RECURSIVE_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ +# into them and run 'make' without going through this Makefile. +# To change the values of 'make' variables: instead of editing Makefiles, +# (1) if the variable is set in 'config.status', edit 'config.status' +# (which will cause the Makefiles to be regenerated when you run 'make'); +# (2) otherwise, pass the desired values on the 'make' command line. +$(am__recursive_targets): + @fail=; \ + if $(am__make_keepgoing); then \ + failcom='fail=yes'; \ + else \ + failcom='exit 1'; \ + fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ - list='$(SUBDIRS)'; for subdir in $$list; do \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ @@ -312,57 +407,12 @@ $(RECURSIVE_TARGETS): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" -$(RECURSIVE_CLEAN_TARGETS): - @fail= failcom='exit 1'; \ - for f in x $$MAKEFLAGS; do \ - case $$f in \ - *=* | --[!k]*);; \ - *k*) failcom='fail=yes';; \ - esac; \ - done; \ - dot_seen=no; \ - case "$@" in \ - distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ - *) list='$(SUBDIRS)' ;; \ - esac; \ - rev=''; for subdir in $$list; do \ - if test "$$subdir" = "."; then :; else \ - rev="$$subdir $$rev"; \ - fi; \ - done; \ - rev="$$rev ."; \ - target=`echo $@ | sed s/-recursive//`; \ - for subdir in $$rev; do \ - echo "Making $$target in $$subdir"; \ - if test "$$subdir" = "."; then \ - local_target="$$target-am"; \ - else \ - local_target="$$target"; \ - fi; \ - ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ - || eval $$failcom; \ - done && test -z "$$fail" -tags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ - done -ctags-recursive: - list='$(SUBDIRS)'; for subdir in $$list; do \ - test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ - done +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-recursive +TAGS: tags -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ @@ -378,12 +428,7 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -395,15 +440,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-recursive + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -412,6 +453,21 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-recursive + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -448,13 +504,10 @@ distdir: $(DISTFILES) done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ - test -d "$(distdir)/$$subdir" \ - || $(MKDIR_P) "$(distdir)/$$subdir" \ - || exit 1; \ - fi; \ - done - @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ - if test "$$subdir" = .; then :; else \ + $(am__make_dryrun) \ + || test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ @@ -489,10 +542,15 @@ install-am: all-am installcheck: installcheck-recursive install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -570,22 +628,20 @@ ps-am: uninstall-am: -.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \ - install-am install-strip tags-recursive - -.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ - all all-am check check-am clean clean-generic clean-libtool \ - ctags ctags-recursive distclean distclean-generic \ - distclean-libtool distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs installdirs-am maintainer-clean \ - maintainer-clean-generic mostlyclean mostlyclean-generic \ - mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ - uninstall uninstall-am +.MAKE: $(am__recursive_targets) install-am install-strip + +.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \ + check-am clean clean-generic clean-libtool cscopelist-am ctags \ + ctags-am distclean distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/examples/classes/Makefile b/examples/classes/Makefile index 4cef07f..aca68d0 100644 --- a/examples/classes/Makefile +++ b/examples/classes/Makefile @@ -1,10 +1,10 @@ -TARGETS= ciphercng swmgrex +TARGETS= ciphercng swmgrex verseranges lastVerseInChapter verseposition showchapter all: $(TARGETS) clean: rm $(TARGETS) .cpp: - g++ -O0 -g `pkg-config --cflags sword` $< -o $@ `pkg-config --libs sword` + g++ -O0 -g -Wall -Werror `pkg-config --cflags sword` $< -o $@ `pkg-config --libs sword` diff --git a/examples/classes/README b/examples/classes/README new file mode 100644 index 0000000..53a65b7 --- /dev/null +++ b/examples/classes/README @@ -0,0 +1,4 @@ +These examples use a standard Makefile which exemplifies how you can compile +your own code against the SWORD engine. +This does, however, require SWORD to be installed before a 'make' in this +folder will be successful. diff --git a/examples/classes/ciphercng.cpp b/examples/classes/ciphercng.cpp index 9859341..f1ce5e8 100644 --- a/examples/classes/ciphercng.cpp +++ b/examples/classes/ciphercng.cpp @@ -1,13 +1,13 @@ /****************************************************************************** * - * This example demonstrates how to change the cipher key of a module - * The change is only in effect for this run. This DOES NOT change the - * cipherkey in the module's .conf file. + * ciphercng.cpp - This example demonstrates how to change the cipher key + * of a module. The change is only in effect for this + * run. This DOES NOT change the cipherkey in the + * module's .conf file. * + * $Id: ciphercng.cpp 2980 2013-09-14 21:51:47Z scribe $ * - * $Id: ciphercng.cpp 2504 2010-01-26 16:46:19Z scribe $ - * - * Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org) + * Copyright 2000-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -33,6 +33,7 @@ using namespace sword; using namespace std; + int main(int argc, char **argv) { if (argc != 2) { @@ -56,13 +57,13 @@ int main(int argc, char **argv) { while (true) { cout << "\nModule text:\n"; module->setKey("1jn 1:9"); - cout << "[ " << module->KeyText() << " ]\n"; - cout << (const char *)*module; + cout << "[ " << module->getKeyText() << " ]\n"; + cout << module->renderText(); cout << "\n\nEnter new cipher key: "; cin >> key; cout << "\nSetting key to: " << key; manager.setCipherKey(argv[1], key.c_str()); } - + return 0; } diff --git a/examples/classes/lastVerseInChapter.cpp b/examples/classes/lastVerseInChapter.cpp new file mode 100644 index 0000000..aac905c --- /dev/null +++ b/examples/classes/lastVerseInChapter.cpp @@ -0,0 +1,56 @@ +/****************************************************************************** + * + * lastVerseInChapter.cpp - This example demonstrates how to navigate + * verses using VerseKey. It uselessly iterates + * every chapter of the KJV, finds the last verse + * and prints out the sole verse in the KJV which + * ends in a ',' -- just for fun. + * + * $Id: lastVerseInChapter.cpp 2980 2013-09-14 21:51:47Z scribe $ + * + * Copyright 2011-2013 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. + * + */ + +#include +#include +#include +#include + + +using namespace sword; +using namespace std; + + +int main(int argc, char **argv) { + + SWMgr library; + + SWModule *book = library.getModule("KJV"); + + VerseKey *vk = (VerseKey *) book->getKey(); + for (;!vk->popError();vk->setChapter(vk->getChapter()+1)) { + vk->setVerse(vk->getVerseMax()); + SWBuf text = book->stripText(); + text = text.trim(); + if (text.endsWith(",")) { + cout << vk->getText() << ":\n\n"; + cout << text << endl; + } + } + + return 0; +} + diff --git a/examples/classes/showchapter.cpp b/examples/classes/showchapter.cpp new file mode 100644 index 0000000..f170b51 --- /dev/null +++ b/examples/classes/showchapter.cpp @@ -0,0 +1,57 @@ +/****************************************************************************** + * + * showchapter.cpp - + * + * $Id: showchapter.cpp 2980 2013-09-14 21:51:47Z scribe $ + * + * Copyright 2013 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. + * + */ + +#include +#include +#include +#include + + +using namespace sword; +using namespace std; + + +int main(int argc, char **argv) { + + SWMgr library; + SWModule *kjv = library.getModule("KJV"); + + kjv->setKey(argc > 1 ? argv[1] : "Jn.3.16"); + + VerseKey *key = (VerseKey *)kjv->getKey(); + + int curVerse = key->getVerse(); + int curChapter = key->getChapter(); + int curBook = key->getBook(); + + for (key->setVerse(1); + (key->getBook() == curBook) && + (key->getChapter() == curChapter) && + !kjv->popError(); + (*kjv)++) { + if (key->getVerse() == curVerse) cout << "* "; + cout << key->getVerse() << " " << kjv->stripText() << "\n"; + } + + return 0; +} + diff --git a/examples/classes/swmgrex.cpp b/examples/classes/swmgrex.cpp index 9978a7b..7fc9f73 100644 --- a/examples/classes/swmgrex.cpp +++ b/examples/classes/swmgrex.cpp @@ -1,19 +1,18 @@ /****************************************************************************** - * Class SWMgr manages installed modules for a frontend. - * SWMgr reads a mods.conf file to discover its information. - * It then instantiates the correct decendent of SWModule for each - * module entry in mods.conf - * The developer may use this class to query what modules are installed - * and to retrieve an (SWModule *) for any one of these modules * - * SWMgr makes its modules available as an STL Map. - * The Map definition is typedef'ed as ModMap - * ModMap consists of: FIRST : SWBuf moduleName - * SECOND: SWModule *module + * swmgrex.cpp - Class SWMgr manages installed modules for a frontend. + * The developer may use this class to query what modules + * are installed and to retrieve an (SWModule *) for any + * one of these modules * - * $Id: swmgrex.cpp 2327 2009-04-22 11:42:33Z scribe $ + * SWMgr makes its modules available as an STL Map. + * The Map definition is typedef'ed as ModMap + * ModMap consists of: FIRST : SWBuf moduleName + * SECOND: SWModule *module * - * Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org) + * $Id: swmgrex.cpp 2980 2013-09-14 21:51:47Z scribe $ + * + * Copyright 1998-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -34,10 +33,13 @@ #include #include + using namespace sword; using namespace std; -main() { + +int main(int argc, char **argv) { + SWMgr manager; // create a default manager that looks in the current directory for mods.conf cout << "\nInstalled Modules:\n\n"; @@ -50,14 +52,14 @@ main() { SWBuf modName = (*modIterator).first; // mod.conf section name (stored in module->Name()) SWModule *module = (*modIterator).second; - cout << modName << "(" << module->Name() << ") | " << module->Type() << "\n"; + cout << modName << "(" << module->getName() << ") | " << module->getType() << "\n"; } // Print out a verse from the first module: - cout << "\n" << manager.Modules.begin()->second->KeyText() << ":\n"; - cout << (const char *)(*manager.Modules.begin()->second); - cout << " (" << manager.Modules.begin()->second->Name() << ")\n"; + cout << "\n" << manager.Modules.begin()->second->getKeyText() << ":\n"; + cout << manager.Modules.begin()->second->renderText(); + cout << " (" << manager.Modules.begin()->second->getName() << ")\n"; // Print out the same verse from the second module (less confusing): @@ -66,9 +68,11 @@ main() { SWModule *mod = modIterator->second; - cout << "\n" << mod->KeyText() << ":\n"; + cout << "\n" << mod->getKeyText() << ":\n"; // cout << (const char *)(*mod); // we could do this, the same as above - mod->Display(); // instead of casting mod to const char * to get its contents, we'll call the default display method that writes to stdout; - cout << " (" << mod->Name() << ")\n\n"; + mod->display(); // instead of casting mod to const char * to get its contents, we'll call the default display method that writes to stdout; + cout << " (" << mod->getName() << ")\n\n"; + + return 0; } diff --git a/examples/classes/verseposition.cpp b/examples/classes/verseposition.cpp new file mode 100644 index 0000000..8e63cb5 --- /dev/null +++ b/examples/classes/verseposition.cpp @@ -0,0 +1,51 @@ +/****************************************************************************** + * + * verseposition.cpp - + * + * $Id: verseposition.cpp 2980 2013-09-14 21:51:47Z scribe $ + * + * Copyright 2012-2013 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. + * + */ + +#include +#include +#include +#include + + +using namespace sword; +using namespace std; + + +int main(int argc, char **argv) { + + const char *modName = "HunKar"; + SWMgr library; + SWModule *book = library.getModule(modName); + if (!book) { + cerr << "Can't find module: " << modName << endl; + return -1; + } + VerseKey* key = ((VerseKey *)book->getKey()); + + key->setIntros(true); + book->setSkipConsecutiveLinks(true); + book->setPosition(TOP); + + cout << *key << endl; + + return 0; +} diff --git a/examples/classes/verseranges.cpp b/examples/classes/verseranges.cpp new file mode 100644 index 0000000..557855a --- /dev/null +++ b/examples/classes/verseranges.cpp @@ -0,0 +1,127 @@ +/****************************************************************************** + * + * verseranges.cpp - This example demonstrates how to work with contiguous + * verse ranges using VerseKey + * + * $Id: verseranges.cpp 2980 2013-09-14 21:51:47Z scribe $ + * + * Copyright 2011-2013 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. + * + */ + +#include + +#include +#include +#include + + +using namespace sword; +using namespace std; + + +int main(int argc, char **argv) { + + cout << "\n"; + + const char *modName = "KJVA"; + SWMgr manager; + SWModule *bible = manager.getModule(modName); + if (!bible) { + cout << modName << " not installed for example. Please install.\n\n"; + exit(-1); + } + + VerseKey *vk = (VerseKey *)bible->createKey(); + + // let's set verse ranges for a variety of different contiguous regions + + // set a verse range for the whole Bible + vk->setLowerBound(*vk); // vk initially points to TOP, so we don't need to set position first + vk->setPosition(BOTTOM); + vk->setUpperBound(*vk); + cout << vk->getRangeText() << "\n"; + + + vk->clearBounds(); + + + // Old Testament + vk->setPosition(TOP); + vk->setLowerBound(*vk); + + vk->setTestament(2); + (*vk)--; + + vk->setUpperBound(*vk); + cout << vk->getRangeText() << "\n"; + + + vk->clearBounds(); + + + // New Testament + vk->setPosition(TOP); + vk->setTestament(2); + vk->setLowerBound(*vk); + vk->setPosition(BOTTOM); + vk->setUpperBound(*vk); + cout << vk->getRangeText() << "\n"; + + + vk->clearBounds(); + + + // Current Book + vk->setText("John 3:16"); + vk->setChapter(1); vk->setVerse(1); + vk->setLowerBound(*vk); + vk->setChapter(vk->getChapterMax()); vk->setVerse(vk->getVerseMax()); + vk->setUpperBound(*vk); + cout << vk->getRangeText() << "\n"; + + + // ------------------------- + // Shorter syntax using the parser and based on book names, and requires intimate knowledge of VersificationMgr + // You're probably better off using the above code, but this is here for completeness + // + const VersificationMgr::System *refSys = VersificationMgr::getSystemVersificationMgr()->getVersificationSystem(vk->getVersificationSystem()); + + + // whole Bible + VerseKey vkBible(refSys->getBook(0)->getOSISName(), refSys->getBook(refSys->getBookCount()-1)->getOSISName(), refSys->getName()); + cout << vkBible.getRangeText() << "\n"; + + // OT + VerseKey vkOT(refSys->getBook(0)->getOSISName(), refSys->getBook(refSys->getBMAX()[0]-1)->getOSISName(), refSys->getName()); + cout << vkOT.getRangeText() << "\n"; + + // NT + VerseKey vkNT(refSys->getBook(refSys->getBMAX()[0])->getOSISName(), refSys->getBook(refSys->getBookCount()-1)->getOSISName(), refSys->getName()); + cout << vkNT.getRangeText() << "\n"; + + // Current Book + vk->setText("John 3:16"); + VerseKey vkCurrentBook(vk->getBookName(), vk->getBookName(), refSys->getName()); + cout << vkCurrentBook.getRangeText() << "\n"; + + + delete vk; + + cout << endl; + + return 0; +} + diff --git a/examples/cmdline/CMakeLists.txt b/examples/cmdline/CMakeLists.txt index 922c2d8..bfbb995 100644 --- a/examples/cmdline/CMakeLists.txt +++ b/examples/cmdline/CMakeLists.txt @@ -3,6 +3,7 @@ # SWORD_BUILD_EXAMPLES="Yes". These will not be installed, so don't worry about # that. # +MESSAGE(STATUS "\n-- CONFIGURING LIBRARY EXAMPLES") SET(example_PROGRAMS listoptions lookup diff --git a/examples/cmdline/Makefile.am b/examples/cmdline/Makefile.am index e7409dd..1b14b67 100644 --- a/examples/cmdline/Makefile.am +++ b/examples/cmdline/Makefile.am @@ -1,7 +1,7 @@ AUTOMAKE_OPTIONS = 1.6 -INCLUDES = -I $(top_srcdir)/include +AM_CPPFLAGS = -I $(top_srcdir)/include if USE_INTERNAL_REGEX -INCLUDES += -I$(top_srcdir)/include/internal/regex +AM_CPPFLAGS += -I$(top_srcdir)/include/internal/regex endif LDADD = $(top_builddir)/lib/libsword.la diff --git a/examples/cmdline/Makefile.in b/examples/cmdline/Makefile.in index fe4ca69..a3cb2f4 100644 --- a/examples/cmdline/Makefile.in +++ b/examples/cmdline/Makefile.in @@ -1,9 +1,8 @@ -# Makefile.in generated by automake 1.11.1 from Makefile.am. +# Makefile.in generated by automake 1.13.4 from Makefile.am. # @configure_input@ -# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, -# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. @@ -16,6 +15,51 @@ @SET_MAKE@ VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -40,13 +84,14 @@ noinst_PROGRAMS = lookup$(EXEEXT) search$(EXEEXT) \ threaded_search$(EXEEXT) listoptions$(EXEEXT) \ verserangeparse$(EXEEXT) outplain$(EXEEXT) outrender$(EXEEXT) subdir = examples/cmdline -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ + $(top_srcdir)/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/acx_clucene.m4 \ - $(top_srcdir)/m4/colored-echo.m4 $(top_srcdir)/m4/cppunit.m4 \ - $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ - $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ - $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/cppunit.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \ + $(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -58,6 +103,10 @@ am_listoptions_OBJECTS = listoptions.$(OBJEXT) listoptions_OBJECTS = $(am_listoptions_OBJECTS) listoptions_LDADD = $(LDADD) listoptions_DEPENDENCIES = $(top_builddir)/lib/libsword.la +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = am_lookup_OBJECTS = lookup.$(OBJEXT) lookup_OBJECTS = $(am_lookup_OBJECTS) lookup_LDADD = $(LDADD) @@ -81,31 +130,76 @@ am_verserangeparse_OBJECTS = verserangeparse.$(OBJEXT) verserangeparse_OBJECTS = $(am_verserangeparse_OBJECTS) verserangeparse_LDADD = $(LDADD) verserangeparse_DEPENDENCIES = $(top_builddir)/lib/libsword.la +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ - $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +AM_V_CXX = $(am__v_CXX_@AM_V@) +am__v_CXX_ = $(am__v_CXX_@AM_DEFAULT_V@) +am__v_CXX_0 = @echo " CXX " $@; +am__v_CXX_1 = CXXLD = $(CXX) -CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ - $(LDFLAGS) -o $@ +CXXLINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CXXLD = $(am__v_CXXLD_@AM_V@) +am__v_CXXLD_ = $(am__v_CXXLD_@AM_DEFAULT_V@) +am__v_CXXLD_0 = @echo " CXXLD " $@; +am__v_CXXLD_1 = SOURCES = $(listoptions_SOURCES) $(lookup_SOURCES) $(outplain_SOURCES) \ $(outrender_SOURCES) $(search_SOURCES) \ $(threaded_search_SOURCES) $(verserangeparse_SOURCES) DIST_SOURCES = $(listoptions_SOURCES) $(lookup_SOURCES) \ $(outplain_SOURCES) $(outrender_SOURCES) $(search_SOURCES) \ $(threaded_search_SOURCES) $(verserangeparse_SOURCES) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ +AM_CFLAGS = @AM_CFLAGS@ AM_CXXFLAGS = @AM_CXXFLAGS@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ @@ -115,6 +209,8 @@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ +CLUCENE2_CFLAGS = @CLUCENE2_CFLAGS@ +CLUCENE2_LIBS = @CLUCENE2_LIBS@ CLUCENE_CXXFLAGS = @CLUCENE_CXXFLAGS@ CLUCENE_LIBS = @CLUCENE_LIBS@ CPP = @CPP@ @@ -140,9 +236,6 @@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ -GENCCODE = @GENCCODE@ -GENCMN = @GENCMN@ -GENRB = @GENRB@ GREP = @GREP@ ICU_CONFIG = @ICU_CONFIG@ ICU_IOLIBS = @ICU_IOLIBS@ @@ -163,6 +256,7 @@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ @@ -175,20 +269,29 @@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ -PKGDATA = @PKGDATA@ PKG_CONFIG = @PKG_CONFIG@ +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +SWORD_VERSION_MAJOR = @SWORD_VERSION_MAJOR@ +SWORD_VERSION_MICRO = @SWORD_VERSION_MICRO@ +SWORD_VERSION_MINOR = @SWORD_VERSION_MINOR@ +SWORD_VERSION_NANO = @SWORD_VERSION_NANO@ +SWORD_VERSION_NUM = @SWORD_VERSION_NUM@ +SWORD_VERSION_STR = @SWORD_VERSION_STR@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ @@ -225,7 +328,6 @@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ -lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -252,7 +354,7 @@ with_icu = @with_icu@ with_icusword = @with_icusword@ with_zlib = @with_zlib@ AUTOMAKE_OPTIONS = 1.6 -INCLUDES = -I $(top_srcdir)/include $(am__append_1) +AM_CPPFLAGS = -I $(top_srcdir)/include $(am__append_1) LDADD = $(top_builddir)/lib/libsword.la lookup_SOURCES = lookup.cpp search_SOURCES = search.cpp @@ -305,27 +407,34 @@ clean-noinstPROGRAMS: list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list -listoptions$(EXEEXT): $(listoptions_OBJECTS) $(listoptions_DEPENDENCIES) + +listoptions$(EXEEXT): $(listoptions_OBJECTS) $(listoptions_DEPENDENCIES) $(EXTRA_listoptions_DEPENDENCIES) @rm -f listoptions$(EXEEXT) - $(CXXLINK) $(listoptions_OBJECTS) $(listoptions_LDADD) $(LIBS) -lookup$(EXEEXT): $(lookup_OBJECTS) $(lookup_DEPENDENCIES) + $(AM_V_CXXLD)$(CXXLINK) $(listoptions_OBJECTS) $(listoptions_LDADD) $(LIBS) + +lookup$(EXEEXT): $(lookup_OBJECTS) $(lookup_DEPENDENCIES) $(EXTRA_lookup_DEPENDENCIES) @rm -f lookup$(EXEEXT) - $(CXXLINK) $(lookup_OBJECTS) $(lookup_LDADD) $(LIBS) -outplain$(EXEEXT): $(outplain_OBJECTS) $(outplain_DEPENDENCIES) + $(AM_V_CXXLD)$(CXXLINK) $(lookup_OBJECTS) $(lookup_LDADD) $(LIBS) + +outplain$(EXEEXT): $(outplain_OBJECTS) $(outplain_DEPENDENCIES) $(EXTRA_outplain_DEPENDENCIES) @rm -f outplain$(EXEEXT) - $(CXXLINK) $(outplain_OBJECTS) $(outplain_LDADD) $(LIBS) -outrender$(EXEEXT): $(outrender_OBJECTS) $(outrender_DEPENDENCIES) + $(AM_V_CXXLD)$(CXXLINK) $(outplain_OBJECTS) $(outplain_LDADD) $(LIBS) + +outrender$(EXEEXT): $(outrender_OBJECTS) $(outrender_DEPENDENCIES) $(EXTRA_outrender_DEPENDENCIES) @rm -f outrender$(EXEEXT) - $(CXXLINK) $(outrender_OBJECTS) $(outrender_LDADD) $(LIBS) -search$(EXEEXT): $(search_OBJECTS) $(search_DEPENDENCIES) + $(AM_V_CXXLD)$(CXXLINK) $(outrender_OBJECTS) $(outrender_LDADD) $(LIBS) + +search$(EXEEXT): $(search_OBJECTS) $(search_DEPENDENCIES) $(EXTRA_search_DEPENDENCIES) @rm -f search$(EXEEXT) - $(CXXLINK) $(search_OBJECTS) $(search_LDADD) $(LIBS) -threaded_search$(EXEEXT): $(threaded_search_OBJECTS) $(threaded_search_DEPENDENCIES) + $(AM_V_CXXLD)$(CXXLINK) $(search_OBJECTS) $(search_LDADD) $(LIBS) + +threaded_search$(EXEEXT): $(threaded_search_OBJECTS) $(threaded_search_DEPENDENCIES) $(EXTRA_threaded_search_DEPENDENCIES) @rm -f threaded_search$(EXEEXT) - $(CXXLINK) $(threaded_search_OBJECTS) $(threaded_search_LDADD) $(LIBS) -verserangeparse$(EXEEXT): $(verserangeparse_OBJECTS) $(verserangeparse_DEPENDENCIES) + $(AM_V_CXXLD)$(CXXLINK) $(threaded_search_OBJECTS) $(threaded_search_LDADD) $(LIBS) + +verserangeparse$(EXEEXT): $(verserangeparse_OBJECTS) $(verserangeparse_DEPENDENCIES) $(EXTRA_verserangeparse_DEPENDENCIES) @rm -f verserangeparse$(EXEEXT) - $(CXXLINK) $(verserangeparse_OBJECTS) $(verserangeparse_LDADD) $(LIBS) + $(AM_V_CXXLD)$(CXXLINK) $(verserangeparse_OBJECTS) $(verserangeparse_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -342,25 +451,25 @@ distclean-compile: @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/verserangeparse.Po@am__quote@ .cpp.o: -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ $< .cpp.obj: -@am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: -@am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< -@am__fastdepCXX_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo -@AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -368,26 +477,15 @@ mostlyclean-libtool: clean-libtool: -rm -rf .libs _libs -ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ - mkid -fID $$unique -tags: TAGS - -TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ + $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ @@ -399,15 +497,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $$unique; \ fi; \ fi -ctags: CTAGS -CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ - $(TAGS_FILES) $(LISP) - list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ - unique=`for i in $$list; do \ - if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ - done | \ - $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ - END { if (nonempty) { for (i in files) print i; }; }'`; \ +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique @@ -416,6 +510,21 @@ GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags @@ -464,10 +573,15 @@ install-am: all-am installcheck: installcheck-am install-strip: - $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ - install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ - `test -z '$(STRIP)' || \ - echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi mostlyclean-generic: clean-generic: @@ -552,18 +666,19 @@ uninstall-am: .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS ctags distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ - pdf pdf-am ps ps-am tags uninstall uninstall-am +.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ + clean-libtool clean-noinstPROGRAMS cscopelist-am ctags \ + ctags-am distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + tags tags-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/examples/cmdline/listoptions.cpp b/examples/cmdline/listoptions.cpp index 721e8ea..c5525e9 100644 --- a/examples/cmdline/listoptions.cpp +++ b/examples/cmdline/listoptions.cpp @@ -1,10 +1,14 @@ /****************************************************************************** - * Simple example to show how to see which options are available from the - * installed set of modules and their possible settings. * - * $Id: swmgr.h 2321 2009-04-13 01:17:00Z scribe $ + * listoptions.cpp - Simple example to show how to see which 'options' are + * available from the installed set of modules and their + * possible settings. + * Options in SWORD refer to things like "Strong's + * Numbers", "Morphology", etc. + * + * $Id: listoptions.cpp 2980 2013-09-14 21:51:47Z scribe $ * - * Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org) + * Copyright 2006-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -19,24 +23,30 @@ * General Public License for more details. * */ + #include #include + using sword::SWMgr; using sword::StringList; using std::cout; + int main(int argc, char **argv) { SWMgr library; StringList options = library.getGlobalOptions(); - for (StringList::const_iterator it = options.begin(); it != options.end(); it++) { + for (StringList::const_iterator it = options.begin(); it != options.end(); ++it) { cout << *it << " (" << library.getGlobalOptionTip(*it) << ")\n"; StringList optionValues = library.getGlobalOptionValues(*it); - for (StringList::const_iterator it2 = optionValues.begin(); it2 != optionValues.end(); it2++) { + for (StringList::const_iterator it2 = optionValues.begin(); it2 != optionValues.end(); ++it2) { cout << "\t" << *it2 << "\n"; } } + return 0; + } + diff --git a/examples/cmdline/lookup.cpp b/examples/cmdline/lookup.cpp index 5fecafb..505b5e1 100644 --- a/examples/cmdline/lookup.cpp +++ b/examples/cmdline/lookup.cpp @@ -1,9 +1,11 @@ /****************************************************************************** - * Simple example of how to retrieve an entry from a SWORD module * - * $Id: lookup.cpp 2546 2010-09-08 14:14:37Z scribe $ + * lookup.cpp - Simple example of how to retrieve an entry from a + * SWORD module * - * Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org) + * $Id: lookup.cpp 2980 2013-09-14 21:51:47Z scribe $ + * + * Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -24,9 +26,11 @@ #include #include #include +#include #include #include + using sword::SWMgr; using sword::MarkupFilterMgr; using sword::SWModule; @@ -38,6 +42,8 @@ using sword::AttributeTypeList; using sword::AttributeList; using sword::AttributeValue; using sword::VerseKey; +using sword::FilterList; + int main(int argc, char **argv) { @@ -57,8 +63,8 @@ int main(int argc, char **argv) if (!target) { fprintf(stderr, "Could not find module [%s]. Available modules:\n", argv[1]); ModMap::iterator it; - for (it = manager.Modules.begin(); it != manager.Modules.end(); it++) { - fprintf(stderr, "[%s]\t - %s\n", (*it).second->Name(), (*it).second->Description()); + for (it = manager.Modules.begin(); it != manager.Modules.end(); ++it) { + fprintf(stderr, "[%s]\t - %s\n", (*it).second->getName(), (*it).second->getDescription()); } exit(-1); } @@ -73,36 +79,40 @@ int main(int argc, char **argv) if (vk) { // vk->AutoNormalize(false); - vk->Headings(true); + vk->setIntros(true); vk->setText(argv[2]); } else { target->setKey(argv[2]); } - target->RenderText(); // force an entry lookup to resolve key to something in the index + target->renderText(); // force an entry lookup to resolve key to something in the index std::cout << "==Raw=Entry===============\n"; std::cout << target->getKeyText() << ":\n"; std::cout << target->getRawEntry(); std::cout << "\n"; std::cout << "==Render=Entry============\n"; - std::cout << target->RenderText(); + std::cout << target->getRenderHeader(); + std::cout << "\n"; + std::cout << target->renderText(); 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++) { + for (i1 = target->getEntryAttributes().begin(); i1 != target->getEntryAttributes().end(); ++i1) { std::cout << "[ " << i1->first << " ]\n"; - for (i2 = i1->second.begin(); i2 != i1->second.end(); i2++) { + for (i2 = i1->second.begin(); i2 != i1->second.end(); ++i2) { std::cout << "\t[ " << i2->first << " ]\n"; - for (i3 = i2->second.begin(); i3 != i2->second.end(); i3++) { + for (i3 = i2->second.begin(); i3 != i2->second.end(); ++i3) { std::cout << "\t\t" << i3->first << " = " << i3->second << "\n"; } } } std::cout << std::endl; + return 0; } + diff --git a/examples/cmdline/outplain.cpp b/examples/cmdline/outplain.cpp index f95be88..5245fda 100644 --- a/examples/cmdline/outplain.cpp +++ b/examples/cmdline/outplain.cpp @@ -1,11 +1,17 @@ /****************************************************************************** - * This example show how to output the plain text entries from a SWORD module. - * This is also good for speed tests + * + * outplain.cpp - This example shows how to output the plain text + * entries from a SWORD module. This small program + * outputs a SWORD module in 'imp' format, e.g.: + * + * $$$Gen.1.1 + * In the beginning God created + * the heavens and the earth + * + * $$$Gen.1.2 + * ... * * Class SWMgr manages installed modules for a frontend. - * SWMgr reads a mods.conf file to discover its information. - * It then instantiates the correct decendent of SWModule for each - * module entry in mods.conf * The developer may use this class to query what modules are installed * and to retrieve an (SWModule *) for any one of these modules * @@ -14,9 +20,9 @@ * ModMap consists of: FIRST : SWBuf moduleName * SECOND: SWModule *module * - * $Id: swmgr.h 2321 2009-04-13 01:17:00Z scribe $ + * $Id: outplain.cpp 2980 2013-09-14 21:51:47Z scribe $ * - * Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org) + * Copyright 2008-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -32,21 +38,6 @@ * */ -/****************************************************************************** - * Class SWMgr manages installed modules for a frontend. - * SWMgr reads a mods.conf file to discover its information. - * It then instantiates the correct decendent of SWModule for each - * module entry in mods.conf - * The developer may use this class to query what modules are installed - * and to retrieve an (SWModule *) for any one of these modules - * - * SWMgr makes its modules available as an STL Map. - * The Map definition is typedef'ed as ModMap - * ModMap consists of: FIRST : SWBuf moduleName - * SECOND: SWModule *module - * - */ - #include #include @@ -54,24 +45,29 @@ #include #include + using namespace sword; using namespace std; + int main(int argc, char **argv) { + SWMgr manager(new MarkupFilterMgr(sword::FMT_HTMLHREF, sword::ENC_UTF16)); const char *bookName = (argc > 1) ? argv[1] : "WLC"; SWModule *b = manager.getModule(bookName); if (!b) return -1; SWModule &book = *b; - book.processEntryAttributes(false); + book.setProcessEntryAttributes(false); VerseKey *vk = SWDYNAMIC_CAST(VerseKey, book.getKey()); - for (book = TOP; !book.Error() && !book.getRawEntryBuf().size(); book++); + for (book = TOP; !book.popError() && !book.getRawEntryBuf().size(); book++); if (!book.getRawEntryBuf().size()) return -2; // empty module - for (;!book.Error(); book++) { + for (;!book.popError(); book++) { cout << "$$$"; if (vk) cout << vk->getOSISRef(); else cout << book.getKeyText(); - cout << "\n" << book.StripText() << "\n\n"; + cout << "\n" << book.stripText() << "\n\n"; } + + return 0; } diff --git a/examples/cmdline/outrender.cpp b/examples/cmdline/outrender.cpp index 99cc39e..192b29d 100644 --- a/examples/cmdline/outrender.cpp +++ b/examples/cmdline/outrender.cpp @@ -1,22 +1,13 @@ /****************************************************************************** - * This example show how to choose an output render markup and render - * entries from a SWORD module. * - * Class SWMgr manages installed modules for a frontend. - * SWMgr reads a mods.conf file to discover its information. - * It then instantiates the correct decendent of SWModule for each - * module entry in mods.conf - * The developer may use this class to query what modules are installed - * and to retrieve an (SWModule *) for any one of these modules + * outrender.cpp - This example show how to choose an output render + * markup and render entries from a SWORD module. The + * following snippet outputs a module in HTML output + * encoded as UTF8. * - * SWMgr makes its modules available as an STL Map. - * The Map definition is typedef'ed as ModMap - * ModMap consists of: FIRST : SWBuf moduleName - * SECOND: SWModule *module + * $Id: outrender.cpp 2980 2013-09-14 21:51:47Z scribe $ * - * $Id: swmgr.h 2321 2009-04-13 01:17:00Z scribe $ - * - * Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org) + * Copyright 2009-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -39,24 +30,37 @@ #include #include + using namespace sword; using namespace std; + int main(int argc, char **argv) { + SWMgr manager(new MarkupFilterMgr(sword::FMT_HTMLHREF, sword::ENC_UTF16)); const char *bookName = (argc > 1) ? argv[1] : "WLC"; + SWModule *b = manager.getModule(bookName); if (!b) return -1; + SWModule &book = *b; - book.processEntryAttributes(false); + book.setProcessEntryAttributes(false); VerseKey *vk = SWDYNAMIC_CAST(VerseKey, book.getKey()); - for (book = TOP; !book.Error() && !book.getRawEntryBuf().size(); book++); + + // find the first non-zero entry + for (book = TOP; !book.popError() && !book.getRawEntryBuf().size(); book++); if (!book.getRawEntryBuf().size()) return -2; // empty module - for (;!book.Error(); book++) { + + for (;!book.popError(); book++) { + cout << "$$$"; if (vk) cout << vk->getOSISRef(); else cout << book.getKeyText(); - cout << "\n" << book.RenderText() << "\n\n"; + + cout << "\n" << book.renderText() << "\n\n"; } + + return 0; } + diff --git a/examples/cmdline/search.cpp b/examples/cmdline/search.cpp index 1542405..f437430 100644 --- a/examples/cmdline/search.cpp +++ b/examples/cmdline/search.cpp @@ -1,9 +1,14 @@ /****************************************************************************** - * This simple example shows how to perform a search on a SWORD module * - * $Id: search.cpp 2439 2009-08-10 02:37:42Z scribe $ + * search.cpp - This simple example shows how to perform a search on a + * SWORD module. It amounts to a simple commandline + * search tool with a usage like: * - * Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org) + * search KJV "swift hear slow speak" + * + * $Id: search.cpp 2980 2013-09-14 21:51:47Z scribe $ + * + * Copyright 1997-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -31,13 +36,14 @@ using namespace sword; #endif - /* - * >=0 - regex - * -1 - phrase - * -2 - multiword - * -3 - entryAttrib (eg. Word//Lemma/G1234/) - * -4 - Lucene - */ +/* + * >=0 - regex + * -1 - phrase + * -2 - multiword + * -3 - entryAttrib (eg. Word//Lemma/G1234/) + * -4 - Lucene + */ + char SEARCH_TYPE=-2; char printed = 0; @@ -82,8 +88,8 @@ int main(int argc, char **argv) it = manager.Modules.find(argv[1]); if (it == manager.Modules.end()) { fprintf(stderr, "Could not find module [%s]. Available modules:\n", argv[1]); - for (it = manager.Modules.begin(); it != manager.Modules.end(); it++) { - fprintf(stderr, "[%s]\t - %s\n", (*it).second->Name(), (*it).second->Description()); + for (it = manager.Modules.begin(); it != manager.Modules.end(); ++it) { + fprintf(stderr, "[%s]\t - %s\n", (*it).second->getName(), (*it).second->getDescription()); } exit(-1); } @@ -95,8 +101,8 @@ int main(int argc, char **argv) VerseKey *parser = SWDYNAMIC_CAST(VerseKey, k); VerseKey kjvParser; if (!parser) parser = &kjvParser; // use standard KJV parsing as fallback - scope = parser->ParseVerseList(argv[3], *parser, true); - scope.Persist(1); + scope = parser->parseVerseList(argv[3], *parser, true); + scope.setPersist(true); target->setKey(scope); } @@ -106,7 +112,7 @@ int main(int argc, char **argv) std::cerr << std::endl; if (argc > 4) { // if min / max specified scope = listkey; - scope.Persist(1); + scope.setPersist(true); target->setKey(scope); printed = 0; std::cerr << " "; @@ -114,9 +120,11 @@ int main(int argc, char **argv) std::cerr << std::endl; } listkey.sort(); - while (!listkey.Error()) { + while (!listkey.popError()) { std::cout << (const char *)listkey << std::endl; listkey++; } + return 0; + } diff --git a/examples/cmdline/threaded_search.cpp b/examples/cmdline/threaded_search.cpp index cf454a3..a3710a9 100755 --- a/examples/cmdline/threaded_search.cpp +++ b/examples/cmdline/threaded_search.cpp @@ -1,9 +1,10 @@ /****************************************************************************** - * This example shows how to do a thread search * - * $Id: threaded_search.cpp 2327 2009-04-22 11:42:33Z scribe $ + * threaded_search.cpp - This example shows how to do a thread search * - * Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org) + * $Id: threaded_search.cpp 2923 2013-07-28 20:05:37Z scribe $ + * + * Copyright 2000-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -18,6 +19,7 @@ * General Public License for more details. * */ + #include #include #include @@ -98,13 +100,13 @@ void SearchThread::search() { return; } - ListKey scopeList = VerseKey().ParseVerseList("Luke;John;Revelation","", true); - for (int i=0; i < scopeList.Count(); ++i) { - std::cout << (const char*)*scopeList.GetElement(i) << std::endl; + ListKey scopeList = VerseKey().parseVerseList("Luke;John;Revelation","", true); + for (int i=0; i < scopeList.getCount(); ++i) { + std::cout << (const char*)*scopeList.getElement(i) << std::endl; } SWKey* scope = &scopeList; - searchResult = module->Search(searchedText, -2, REG_ICASE, scope, 0, &percentUpdate); + searchResult = module->search(searchedText, -2, REG_ICASE, scope, 0, &percentUpdate); if (!scope) std::cout << "bad scope!" << std::endl; @@ -125,8 +127,8 @@ int main(int argc, char **argv) { it = manager.Modules.find(argv[1]); if (it == manager.Modules.end()) { fprintf(stderr, "Could not find module [%s]. Available modules:\n", argv[1]); - for (it = manager.Modules.begin(); it != manager.Modules.end(); it++) { - fprintf(stderr, "[%s]\t - %s\n", (*it).second->Name(), (*it).second->Description()); + for (it = manager.Modules.begin(); it != manager.Modules.end(); ++it) { + fprintf(stderr, "[%s]\t - %s\n", (*it).second->getName(), (*it).second->getDescription()); } exit(-1); } @@ -144,7 +146,7 @@ int main(int argc, char **argv) { std::cout.flush(); }; - std::cout << std::endl << "Number of found items: " << searchThread->searchResult.Count() << std::endl; + std::cout << std::endl << "Number of found items: " << searchThread->searchResult.getCount() << std::endl; std::cout << "Finished program" << std::endl; std::cout.flush(); diff --git a/examples/cmdline/verserangeparse.cpp b/examples/cmdline/verserangeparse.cpp index aa8cf71..d5fd18b 100644 --- a/examples/cmdline/verserangeparse.cpp +++ b/examples/cmdline/verserangeparse.cpp @@ -1,11 +1,11 @@ -/****************************************************************** - * This example shows: - * How to parse a verse reference - * How to persist a custom range key in a book +/****************************************************************************** * - * $Id: swmgr.h 2321 2009-04-13 01:17:00Z scribe $ + * verserangeparse.cpp - This example shows + * how to parse a verse reference * - * Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org) + * $Id: verserangeparse.cpp 2980 2013-09-14 21:51:47Z scribe $ + * + * Copyright 2006-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -45,42 +45,30 @@ int main(int argc, char **argv) VerseKey parser; ListKey result; - result = parser.ParseVerseList(range, parser, true); + result = parser.parseVerseList(range, parser, true); + // let's iterate the key and display - for (result = TOP; !result.Error(); result++) { + for (result = TOP; !result.popError(); result++) { cout << result << "\n"; } cout << endl; - // Now if we'd like persist this key for use inside of a book... - result.Persist(true); + // Now let's output a module with the entries from the result - // Let's get a book; + // we'll initialize our library of books SWMgr library(new MarkupFilterMgr(FMT_PLAIN)); // render plain without fancy markup + + // Let's get a book; SWModule *book = library.getModule("KJV"); - // and set our limited key inside - book->setKey(result); + // couldn't find our test module + if (!book) return -1; // now let's iterate the book and display - for ((*book) = TOP; !book->Error(); (*book)++) { - cout << "*** " << book->getKeyText() << ": " << book->RenderText() << "\n"; + for (result = TOP; !result.popError(); result++) { + book->setKey(result); + cout << "*** " << book->getKeyText() << ": " << book->renderText() << "\n"; } - // since we've told our result key to persist in book, we can reuse our - // setup by simply resetting result, e.g. - // - // result = parser.ParseVerseList(someNewRange, parser, true); - // - // now an iteration of book will give us our new range. - // - // to stop persistence of our custom key, we'll need to set our book's key - // to something simple: - // - // book->setKey("gen.1.1"); - // - // this allows book to create and use an instance of its preferred key type - // - return 0; } diff --git a/examples/simple.cpp b/examples/simple.cpp index e28d404..c46346b 100644 --- a/examples/simple.cpp +++ b/examples/simple.cpp @@ -1,5 +1,7 @@ /****************************************************************************** - * This is about the simplest useful example of using the sword engine. + * + * simple.cpp - This is about the simplest useful example of using the + * SWORD engine. * * After sword is installed, it should compile with something similar to: * @@ -14,9 +16,9 @@ * * SWMgr library(0, 0, true, new MarkupFilterMgr(FMT_HTMLHREF)); * - * $Id: swmgr.h 2321 2009-04-13 01:17:00Z scribe $ + * $Id: simple.cpp 2980 2013-09-14 21:51:47Z scribe $ * - * Copyright 1998-2009 CrossWire Bible Society (http://www.crosswire.org) + * Copyright 2006-2013 CrossWire Bible Society (http://www.crosswire.org) * CrossWire Bible Society * P. O. Box 2528 * Tempe, AZ 85280-2528 @@ -36,9 +38,11 @@ #include #include + using namespace sword; using std::cout; + int main(int argc, char **argv) { SWMgr library; SWModule *darby = library.getModule("Darby"); @@ -47,3 +51,4 @@ int main(int argc, char **argv) { return 0; } + -- cgit v1.2.3