summaryrefslogtreecommitdiff
path: root/examples/cmdline
diff options
context:
space:
mode:
Diffstat (limited to 'examples/cmdline')
-rw-r--r--examples/cmdline/CMakeLists.txt1
-rw-r--r--examples/cmdline/Makefile.am4
-rw-r--r--examples/cmdline/Makefile.in295
-rw-r--r--examples/cmdline/listoptions.cpp22
-rw-r--r--examples/cmdline/lookup.cpp32
-rw-r--r--examples/cmdline/outplain.cpp48
-rw-r--r--examples/cmdline/outrender.cpp42
-rw-r--r--examples/cmdline/search.cpp40
-rwxr-xr-xexamples/cmdline/threaded_search.cpp22
-rw-r--r--examples/cmdline/verserangeparse.cpp48
10 files changed, 344 insertions, 210 deletions
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 <iostream>
#include <swmgr.h>
+
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 <stdlib.h>
#include <swmgr.h>
#include <swmodule.h>
+#include <swfilter.h>
#include <markupfiltmgr.h>
#include <versekey.h>
+
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 <iostream>
#include <swmgr.h>
@@ -54,24 +45,29 @@
#include <versekey.h>
#include <markupfiltmgr.h>
+
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 <versekey.h>
#include <markupfiltmgr.h>
+
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 <stdio.h>
#include <rawtext.h>
#include <swmgr.h>
@@ -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;
}